fix(locale): fix locale.show not work

This commit is contained in:
vben
2020-12-23 21:16:27 +08:00
parent 5cbfb2a1f9
commit 10cd4fcdff
5 changed files with 15 additions and 5 deletions

View File

@@ -20,6 +20,7 @@ import { transformRouteToMenu } from '/@/router/helper/menuHelper';
import { useMessage } from '/@/hooks/web/useMessage';
// import { warn } from '/@/utils/log';
import { useI18n } from '/@/hooks/web/useI18n';
import { PAGE_NOT_FOUND_ROUTE } from '/@/router/constant';
const { createMessage } = useMessage();
const NAME = 'permission';
@@ -109,7 +110,8 @@ class Permission extends VuexModule {
if (!paramId) {
throw new Error('paramId is undefined!');
}
let routeList: any[] = await getMenuListById({ id: paramId });
let routeList = (await getMenuListById({ id: paramId })) as AppRouteRecordRaw[];
// 动态引入组件
routeList = transformObjToRoute(routeList);
// 后台路由转菜单结构
@@ -117,7 +119,7 @@ class Permission extends VuexModule {
this.commitBackMenuListState(backMenuList);
routes = routeList;
routes = [PAGE_NOT_FOUND_ROUTE, ...routeList];
}
return routes;
}