Skip to content

Commit

Permalink
fix: ensure that the 401 jumps to the login page correctly, fix #512
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Apr 24, 2021
1 parent b7ea68e commit 6a88205
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/store/modules/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6a88205

Please sign in to comment.