Commit d27633fb31824e92cbeb24f8d626d8e33ce7179e
1 parent
30fa4cfa
fix: fixed build warning for style of `intro.js`
修复intro.js的样式文件造成的build警告 fixed: #1130
Showing
1 changed file
with
12 additions
and
2 deletions
src/router/guard/permissionGuard.ts
... | ... | @@ -29,14 +29,24 @@ export function createPermissionGuard(router: Router) { |
29 | 29 | return; |
30 | 30 | } |
31 | 31 | |
32 | + const token = userStore.getToken; | |
33 | + | |
32 | 34 | // Whitelist can be directly entered |
33 | 35 | if (whitePathList.includes(to.path as PageEnum)) { |
36 | + if (to.path === LOGIN_PATH && token) { | |
37 | + const isSessionTimeout = userStore.getSessionTimeout; | |
38 | + try { | |
39 | + await userStore.afterLoginAction(); | |
40 | + if (!isSessionTimeout) { | |
41 | + next((to.query?.redirect as string) || '/'); | |
42 | + return; | |
43 | + } | |
44 | + } catch {} | |
45 | + } | |
34 | 46 | next(); |
35 | 47 | return; |
36 | 48 | } |
37 | 49 | |
38 | - const token = userStore.getToken; | |
39 | - | |
40 | 50 | // token does not exist |
41 | 51 | if (!token) { |
42 | 52 | // You can access without permission. You need to set the routing meta.ignoreAuth to true | ... | ... |