提交 10cd4fcd 作者: vben

fix(locale): fix locale.show not work

上级 5cbfb2a1
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
- 修复混合模式下滚动条丢失问题 - 修复混合模式下滚动条丢失问题
- 修复环境变量配置失效以及 history 模式下 logo 地址问题 - 修复环境变量配置失效以及 history 模式下 logo 地址问题
- 修复图表库切换页面导致宽高计算错误
- 修复多语言配置 `Locale.show`导致配置不生效
## 2.0.0-rc.14 (2020-12-15) ## 2.0.0-rc.14 (2020-12-15)
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
"@vueuse/core": "^4.0.0", "@vueuse/core": "^4.0.0",
"ant-design-vue": "^2.0.0-rc.5", "ant-design-vue": "^2.0.0-rc.5",
"apexcharts": "^3.23.0", "apexcharts": "^3.23.0",
"axios": "^0.21.0", "axios": "^0.21.1",
"crypto-es": "^1.2.6", "crypto-es": "^1.2.6",
"echarts": "^4.9.0", "echarts": "^4.9.0",
"lodash-es": "^4.17.20", "lodash-es": "^4.17.20",
......
import { getI18n } from '/@/setup/i18n'; import { getI18n } from '/@/setup/i18n';
import projectSetting from '/@/settings/projectSetting';
export function useI18n(namespace?: string) { export function useI18n(namespace?: string) {
function getKey(key: string) { function getKey(key: string) {
...@@ -17,7 +16,7 @@ export function useI18n(namespace?: string) { ...@@ -17,7 +16,7 @@ export function useI18n(namespace?: string) {
}, },
}; };
if (!projectSetting.locale.show || !getI18n()) { if (!getI18n()) {
return normalFn; return normalFn;
} }
......
...@@ -20,6 +20,7 @@ import { transformRouteToMenu } from '/@/router/helper/menuHelper'; ...@@ -20,6 +20,7 @@ import { transformRouteToMenu } from '/@/router/helper/menuHelper';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
// import { warn } from '/@/utils/log'; // import { warn } from '/@/utils/log';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
import { PAGE_NOT_FOUND_ROUTE } from '/@/router/constant';
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const NAME = 'permission'; const NAME = 'permission';
...@@ -109,7 +110,8 @@ class Permission extends VuexModule { ...@@ -109,7 +110,8 @@ class Permission extends VuexModule {
if (!paramId) { if (!paramId) {
throw new Error('paramId is undefined!'); throw new Error('paramId is undefined!');
} }
let routeList: any[] = await getMenuListById({ id: paramId }); let routeList = (await getMenuListById({ id: paramId })) as AppRouteRecordRaw[];
// 动态引入组件 // 动态引入组件
routeList = transformObjToRoute(routeList); routeList = transformObjToRoute(routeList);
// 后台路由转菜单结构 // 后台路由转菜单结构
...@@ -117,7 +119,7 @@ class Permission extends VuexModule { ...@@ -117,7 +119,7 @@ class Permission extends VuexModule {
this.commitBackMenuListState(backMenuList); this.commitBackMenuListState(backMenuList);
routes = routeList; routes = [PAGE_NOT_FOUND_ROUTE, ...routeList];
} }
return routes; return routes;
} }
......
...@@ -2098,6 +2098,13 @@ axios@^0.21.0: ...@@ -2098,6 +2098,13 @@ axios@^0.21.0:
dependencies: dependencies:
follow-redirects "^1.10.0" 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: babel-extract-comments@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.npmjs.org/babel-extract-comments/-/babel-extract-comments-1.0.0.tgz#0a2aedf81417ed391b85e18b4614e693a0351a21" resolved "https://registry.npmjs.org/babel-extract-comments/-/babel-extract-comments-1.0.0.tgz#0a2aedf81417ed391b85e18b4614e693a0351a21"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论