We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
intro.js
1 parent 30fa4cf commit d27633fCopy full SHA for d27633f
src/router/guard/permissionGuard.ts
@@ -29,14 +29,24 @@ export function createPermissionGuard(router: Router) {
29
return;
30
}
31
32
+ const token = userStore.getToken;
33
+
34
// Whitelist can be directly entered
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
46
next();
47
48
49
- const token = userStore.getToken;
-
50
// token does not exist
51
if (!token) {
52
// You can access without permission. You need to set the routing meta.ignoreAuth to true
0 commit comments