♻️ 重构部分路由处理

This commit is contained in:
目棃
2025-01-17 14:48:38 +08:00
parent a3c78ce134
commit da78d27239
4 changed files with 38 additions and 12 deletions

View File

@@ -212,11 +212,13 @@ async function handleDeepLink(payload: string): Promise<void> {
}
if (payload.startsWith("router?path=")) {
const routerPath = payload.replace("router?path=", "");
if (router.currentRoute.value.path === routerPath) {
const curPath = router.currentRoute.value.path;
if (curPath === routerPath) {
showSnackbar.warn("已在当前页面!", 3000);
return;
}
await router.push(routerPath);
await router.push({ path: routerPath, query: {} });
window.location.pathname = routerPath;
return;
}
}