mirror of
https://github.com/vbenjs/vben-admin-thin-next.git
synced 2025-01-24 02:00:22 +08:00
fix: ensure that the 401 jumps to the login page correctly, fix #512
This commit is contained in:
parent
b7ea68e6f8
commit
6a8820597f
@ -117,14 +117,17 @@ export const usePermissionStore = defineStore({
|
||||
|
||||
// !Simulate to obtain permission codes from the background,
|
||||
// this function may only need to be executed once, and the actual project can be put at the right time by itself
|
||||
let routeList: AppRouteRecordRaw[] = [];
|
||||
try {
|
||||
this.changePermissionCode('1');
|
||||
} catch (error) {}
|
||||
routeList = (await getMenuListById({ id: paramId })) as AppRouteRecordRaw[];
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
if (!paramId) {
|
||||
throw new Error('paramId is undefined!');
|
||||
}
|
||||
let routeList = (await getMenuListById({ id: paramId })) as AppRouteRecordRaw[];
|
||||
|
||||
// Dynamically introduce components
|
||||
routeList = transformObjToRoute(routeList);
|
||||
|
Loading…
Reference in New Issue
Block a user