️ 对签到链接跳转进行处理,优化部分网页活动打开

This commit is contained in:
目棃
2024-04-29 00:30:02 +08:00
parent abb0a6e751
commit 6316cc42b2
3 changed files with 37 additions and 8 deletions

View File

@@ -189,13 +189,26 @@ async function getDeepLink(): Promise<UnlistenFn> {
e.payload.startsWith("teyvatguide://import_uiaf")
) {
await toUIAF(e.payload);
} else {
showSnackbar({
text: "无效的 deep link",
color: "error",
timeout: 3000,
});
return;
}
if (e.payload.startsWith("router?path=")) {
const routerPath = e.payload.replace("router?path=", "");
if (router.currentRoute.value.path === routerPath) {
showSnackbar({
text: "已在当前页面!",
color: "warn",
timeout: 3000,
});
return;
}
await router.push(routerPath);
return;
}
showSnackbar({
text: "无效的 deep link",
color: "error",
timeout: 3000,
});
});
}