This commit is contained in:
2025-07-08 09:14:22 +08:00
parent aa71fd5c7e
commit 01f3339833
10 changed files with 122 additions and 31 deletions
+10 -9
View File
@@ -48,17 +48,18 @@ const router: Router = createRouter({
history: createWebHistory('/'),
routes: [...routes],
});
const xian = ['/home', '/secondScreen', '/transfer'];
const yinchuan = ['/yinChuanHome', '/yinChuanTest', '/transfer'];
router.beforeEach((to, from, next) => {
if (to.path !== '/login' && to.path !== '/home') {
setCurrentPath(to.path);
}
const flag = getAuthCache('flag3');
const token = getAuthCache(TOKEN_KEY);
if (!flag || !token) {
return next({ path: '/login' });
if (to.path == '/login') {
next();
} else {
const flag = getAuthCache('flag3');
const token = getAuthCache(TOKEN_KEY);
if (!flag || !token) {
return next({ path: '/login' });
} else {
next();
}
}
next();