提交 10cd4fcd 编写于 作者: V vben

fix(locale): fix locale.show not work

上级 5cbfb2a1
......@@ -9,6 +9,8 @@
- 修复混合模式下滚动条丢失问题
- 修复环境变量配置失效以及 history 模式下 logo 地址问题
- 修复图表库切换页面导致宽高计算错误
- 修复多语言配置 `Locale.show`导致配置不生效
## 2.0.0-rc.14 (2020-12-15)
......
import { getI18n } from '/@/setup/i18n';
import projectSetting from '/@/settings/projectSetting';
export function useI18n(namespace?: string) {
function getKey(key: string) {
......@@ -17,7 +16,7 @@ export function useI18n(namespace?: string) {
},
};
if (!projectSetting.locale.show || !getI18n()) {
if (!getI18n()) {
return normalFn;
}
......
......@@ -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;
}
......
......@@ -2098,6 +2098,13 @@ axios@^0.21.0:
dependencies:
follow-redirects "^1.10.0"
axios@^0.21.1:
version "0.21.1"
resolved "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8"
integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==
dependencies:
follow-redirects "^1.10.0"
babel-extract-comments@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/babel-extract-comments/-/babel-extract-comments-1.0.0.tgz#0a2aedf81417ed391b85e18b4614e693a0351a21"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册