Skip to content

Commit 6a88205

Browse files
committed
fix: ensure that the 401 jumps to the login page correctly, fix #512
1 parent b7ea68e commit 6a88205

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/store/modules/permission.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,17 @@ export const usePermissionStore = defineStore({
117117

118118
// !Simulate to obtain permission codes from the background,
119119
// this function may only need to be executed once, and the actual project can be put at the right time by itself
120+
let routeList: AppRouteRecordRaw[] = [];
120121
try {
121122
this.changePermissionCode('1');
122-
} catch (error) {}
123+
routeList = (await getMenuListById({ id: paramId })) as AppRouteRecordRaw[];
124+
} catch (error) {
125+
console.error(error);
126+
}
123127

124128
if (!paramId) {
125129
throw new Error('paramId is undefined!');
126130
}
127-
let routeList = (await getMenuListById({ id: paramId })) as AppRouteRecordRaw[];
128131

129132
// Dynamically introduce components
130133
routeList = transformObjToRoute(routeList);

0 commit comments

Comments
 (0)