🐛 路由跳转优化

This commit is contained in:
BTMuli
2023-09-23 20:58:10 +08:00
parent b727688e9c
commit de810278bd
3 changed files with 9 additions and 3 deletions

View File

@@ -125,7 +125,6 @@ async function getDeepLink(): Promise<void> {
} else {
await router.push("/achievements/?app=" + appName);
}
window.location.reload();
} else {
showSnackbar({
text: "无效的 deep link",

View File

@@ -376,7 +376,6 @@ async function handleImportOuter(app: string): Promise<void> {
} finally {
setTimeout(async () => {
await router.push("/achievements");
window.location.reload();
}, 1500);
}
} else {

View File

@@ -2,7 +2,7 @@
* @file router index.ts
* @description 路由入口
* @author BTMuli<bt-muli@outlook.com>
* @since Alpha v0.1.2
* @since Beta v0.3.2
*/
import { createRouter, createWebHistory } from "vue-router";
@@ -13,4 +13,12 @@ const router = createRouter({
routes,
});
// 解决路由重复问题
router.afterEach((to, from) => {
if (from.name === to.name) {
console.log("路由重复");
window.location.reload();
}
});
export default router;