♻️ use opener instead of window.open/shell

This commit is contained in:
目棃
2025-03-18 14:52:00 +08:00
parent 765c860473
commit 01dc6a6ea7
17 changed files with 213 additions and 217 deletions

View File

@@ -13,6 +13,7 @@
<script lang="ts" setup>
import TMiImg from "@comp/app/t-mi-img.vue";
import showSnackbar from "@comp/func/snackbar.js";
import { openUrl } from "@tauri-apps/plugin-opener";
import { computed, toRaw } from "vue";
import { useRouter } from "vue-router";
@@ -62,7 +63,7 @@ async function toLink(): Promise<void> {
showSnackbar.error(`未知链接:${link}`, 3000);
return;
}
window.open(res);
await openUrl(res);
}
</script>
<style lang="css" scoped>

View File

@@ -21,6 +21,7 @@
</template>
<script lang="ts" setup>
import showSnackbar from "@comp/func/snackbar.js";
import { openUrl } from "@tauri-apps/plugin-opener";
import { onMounted, ref, shallowRef, StyleValue, toRaw } from "vue";
import { parseLink, parsePost } from "@/utils/linkParser.js";
@@ -107,7 +108,7 @@ async function toLink(): Promise<void> {
showSnackbar.error(`未知链接:${link}`, 3000);
return;
}
window.open(res);
await openUrl(res);
}
// 解析表情链接