2
0

feat:token修改

This commit is contained in:
zhongzm
2025-01-22 18:40:00 +08:00
parent 3149c19384
commit 0ef88eab88
6 changed files with 15 additions and 15 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('tokenU'));
const needLogin = !to.meta.constant;
const routeRoles = to.meta.roles || [];
@@ -150,7 +150,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('tokenU'));
// initialize the auth route requires the user to be logged in, if not, redirect to the login page
if (!isLogin) {
const loginRoute: RouteKey = 'login';
@@ -214,7 +214,7 @@ function checkRedirectParams(){
const wanfiRedirectParams = sessionStg.get('wanfiRedirectParams');
if (wanfiRedirectParams) {
if (!['site', 'clientMac'].every(s => Object.keys(wanfiRedirectParams).includes(s))) {
localStg.remove('token');
localStg.remove('tokenU');
sessionStg.remove('wanfiRedirectParams');
reLoadLocationHref();
}