Skip to content

Commit d27633f

Browse files
committed
fix: fixed build warning for style of intro.js
修复intro.js的样式文件造成的build警告 fixed: #1130
1 parent 30fa4cf commit d27633f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/router/guard/permissionGuard.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,24 @@ export function createPermissionGuard(router: Router) {
2929
return;
3030
}
3131

32+
const token = userStore.getToken;
33+
3234
// Whitelist can be directly entered
3335
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+
}
3446
next();
3547
return;
3648
}
3749

38-
const token = userStore.getToken;
39-
4050
// token does not exist
4151
if (!token) {
4252
// You can access without permission. You need to set the routing meta.ignoreAuth to true

0 commit comments

Comments
 (0)