From 7cf5e0018c87720303f731317b5eb3cb7d127327 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Sun, 15 Oct 2023 13:10:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=90=8E=E8=AE=BF=E9=97=AE=E9=A6=96=E9=A1=B5=E5=8D=B4=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=88=B0=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #23 --- continew-admin-ui/src/router/guard/index.ts | 2 +- continew-admin-ui/src/router/guard/userLoginInfo.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 {