diff --git a/continew-admin-ui/src/router/guard/index.ts b/continew-admin-ui/src/router/guard/index.ts index c03a99c3..bedc28d2 100644 --- a/continew-admin-ui/src/router/guard/index.ts +++ b/continew-admin-ui/src/router/guard/index.ts @@ -11,7 +11,7 @@ function setupPageGuard(router: Router) { } export default function createRouteGuard(router: Router) { + setupPageGuard(router); setupUserLoginInfoGuard(router); setupPermissionGuard(router); - setupPageGuard(router); } diff --git a/continew-admin-ui/src/router/guard/userLoginInfo.ts b/continew-admin-ui/src/router/guard/userLoginInfo.ts index aa39b721..dd842ae1 100644 --- a/continew-admin-ui/src/router/guard/userLoginInfo.ts +++ b/continew-admin-ui/src/router/guard/userLoginInfo.ts @@ -11,6 +11,11 @@ export default function setupUserLoginInfoGuard(router: Router) { const appStore = useAppStore(); appStore.init(); if (isLogin()) { + if (to.name === 'login') { + next({ name: 'Workplace' }); + NProgress.done(); + return; + } if (loginStore.roles[0]) { next(); } else {