diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index 9bd6605b8..cb3f421ac 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -9,6 +9,8 @@ - 修复混合模式下滚动条丢失问题 - 修复环境变量配置失效以及 history 模式下 logo 地址问题 +- 修复图表库切换页面导致宽高计算错误 +- 修复多语言配置 `Locale.show`导致配置不生效 ## 2.0.0-rc.14 (2020-12-15) diff --git a/package.json b/package.json index 71d84fade..e86aa5470 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@vueuse/core": "^4.0.0", "ant-design-vue": "^2.0.0-rc.5", "apexcharts": "^3.23.0", - "axios": "^0.21.0", + "axios": "^0.21.1", "crypto-es": "^1.2.6", "echarts": "^4.9.0", "lodash-es": "^4.17.20", diff --git a/src/hooks/web/useI18n.ts b/src/hooks/web/useI18n.ts index cacb4c5aa..feccc2ddc 100644 --- a/src/hooks/web/useI18n.ts +++ b/src/hooks/web/useI18n.ts @@ -1,5 +1,4 @@ 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; } diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index ab1497bc3..0ec845a84 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -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; } diff --git a/yarn.lock b/yarn.lock index 1ce764a7e..ceb4b38f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"