提交 6a882059 作者: Vben

fix: ensure that the 401 jumps to the login page correctly, fix #512

上级 b7ea68e6
...@@ -117,14 +117,17 @@ export const usePermissionStore = defineStore({ ...@@ -117,14 +117,17 @@ export const usePermissionStore = defineStore({
// !Simulate to obtain permission codes from the background, // !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 // 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 { try {
this.changePermissionCode('1'); this.changePermissionCode('1');
} catch (error) {} routeList = (await getMenuListById({ id: paramId })) as AppRouteRecordRaw[];
} catch (error) {
console.error(error);
}
if (!paramId) { if (!paramId) {
throw new Error('paramId is undefined!'); throw new Error('paramId is undefined!');
} }
let routeList = (await getMenuListById({ id: paramId })) as AppRouteRecordRaw[];
// Dynamically introduce components // Dynamically introduce components
routeList = transformObjToRoute(routeList); routeList = transformObjToRoute(routeList);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论