2
0

fix:token修复

This commit is contained in:
zhongzm
2025-01-23 21:05:02 +08:00
parent 219584525f
commit 489d4c8603
6 changed files with 13 additions and 13 deletions

View File

@@ -30,7 +30,7 @@ export function createRouteGuard(router: Router) {
const loginRoute: RouteKey = 'login';
const noAuthorizationRoute: RouteKey = '403';
const isLogin = Boolean(localStg.get('token'));
const isLogin = Boolean(localStg.get('tokenSys'));
const needLogin = !to.meta.constant;
const routeRoles = to.meta.roles || [];
@@ -147,7 +147,7 @@ async function checkRoute(to: RouteLocationNormalized): Promise<RouteLocationRaw
}
// if the auth route is not initialized, then initialize the auth route
const isLogin = Boolean(localStg.get('token'));
const isLogin = Boolean(localStg.get('tokenSys'));
// initialize the auth route requires the user to be logged in, if not, redirect to the login page
if (!isLogin) {
const loginRoute: RouteKey = 'login';