From 8f322eae45659ec80532ea73728c48e9aeba9ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Thu, 4 Apr 2024 23:14:09 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E6=90=9C?= =?UTF-8?q?=E7=B4=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 29 ++++++++++++++------------- src/components/post/to-postSearch.vue | 5 +++++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/App.vue b/src/App.vue index f118204a..ee06f8cd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -184,20 +184,11 @@ async function getDeepLink(): Promise { } await TGLogger.Info(`[App][getDeepLink] ${e.payload}`); if (e.payload === "") return; - // 导入格式: teyvatguide://import_uigf?app=appName - // 跳转格式: localhost:4000/achievements/?app=appName - // todo 后续更改路径&参数名称 - if (e.payload.startsWith("teyvatguide://import_uigf")) { - const param = (e.payload).split("teyvatguide://import_uigf/?")[1]; - let appName = ""; - if (param) { - appName = param.split("app=")[1]; - } - if (appName === "") { - await router.push("/achievements"); - } else { - await router.push("/achievements/?app=" + appName); - } + if ( + e.payload.startsWith("teyvatguide://import_uigf") || + e.payload.startsWith("teyvatguide://import_uiaf") + ) { + await toUIAF(e.payload); } else { showSnackbar({ text: "无效的 deep link!", @@ -208,6 +199,16 @@ async function getDeepLink(): Promise { }); } +async function toUIAF(link: string) { + const url = new URL(link); + const app = url.searchParams.get("app"); + if (app === null) { + await router.push("/achievements"); + } else { + await router.push("/achievements/?app=" + app); + } +} + // 检测更新 async function checkUpdate(): Promise { const isProdEnv = import.meta.env.MODE === "production"; diff --git a/src/components/post/to-postSearch.vue b/src/components/post/to-postSearch.vue index a9f3ee38..b59ab02c 100644 --- a/src/components/post/to-postSearch.vue +++ b/src/components/post/to-postSearch.vue @@ -40,6 +40,7 @@ interface ToPostSearchProps { interface ToPostSearchEmits { (e: "update:modelValue", value: boolean): void; + (e: "cancel"): void; } @@ -94,6 +95,7 @@ watch( results.value = []; lastId.value = ""; isLast.value = false; + await searchPosts(); } }, ); @@ -143,6 +145,9 @@ async function searchPosts() { lastId.value = res.last_id; isLast.value = res.is_last; load.value = false; + if (!visible.value) { + visible.value = true; + } } function getGidLabel(): string {