Commit 6a8820597fb58ef7cda7ead59f5cbb4c72c0f882
1 parent
b7ea68e6
fix: ensure that the 401 jumps to the login page correctly, fix #512
Showing
1 changed file
with
5 additions
and
2 deletions
src/store/modules/permission.ts
... | ... | @@ -117,14 +117,17 @@ export const usePermissionStore = defineStore({ |
117 | 117 | |
118 | 118 | // !Simulate to obtain permission codes from the background, |
119 | 119 | // 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[] = []; | |
120 | 121 | try { |
121 | 122 | this.changePermissionCode('1'); |
122 | - } catch (error) {} | |
123 | + routeList = (await getMenuListById({ id: paramId })) as AppRouteRecordRaw[]; | |
124 | + } catch (error) { | |
125 | + console.error(error); | |
126 | + } | |
123 | 127 | |
124 | 128 | if (!paramId) { |
125 | 129 | throw new Error('paramId is undefined!'); |
126 | 130 | } |
127 | - let routeList = (await getMenuListById({ id: paramId })) as AppRouteRecordRaw[]; | |
128 | 131 | |
129 | 132 | // Dynamically introduce components |
130 | 133 | routeList = transformObjToRoute(routeList); | ... | ... |