From 2888f8c4f189b61af9345089ef05e4fceef49685 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Tue, 23 Aug 2022 10:43:33 +0800 Subject: [PATCH] release: update 3.4.6 --- index.html | 3 --- package.json | 4 ++-- pnpm-lock.yaml | 2 +- public/serverConfig.json | 2 +- src/router/utils.ts | 23 ++++++++++++++--------- vite.config.ts | 2 ++ 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/index.html b/index.html index 015919e..a3bed7e 100644 --- a/index.html +++ b/index.html @@ -10,9 +10,6 @@ /> pure-admin-thin - diff --git a/package.json b/package.json index a9f9ac0..36fb1ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pure-admin-thin", - "version": "3.4.5", + "version": "3.4.6", "private": true, "scripts": { "dev": "cross-env --max_old_space_size=4096 vite", @@ -116,7 +116,7 @@ "stylelint-config-standard": "^24.0.0", "stylelint-order": "^5.0.0", "typescript": "^4.7.4", - "unocss": "^0.45.9", + "unocss": "^0.45.12", "unplugin-vue-define-options": "^0.7.3", "vite": "^3.0.9", "vite-plugin-mock": "^2.9.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e037328..d2efa63 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -81,7 +81,7 @@ specifiers: stylelint-config-standard: ^24.0.0 stylelint-order: ^5.0.0 typescript: ^4.7.4 - unocss: ^0.45.9 + unocss: ^0.45.12 unplugin-vue-define-options: ^0.7.3 vite: ^3.0.9 vite-plugin-mock: ^2.9.6 diff --git a/public/serverConfig.json b/public/serverConfig.json index eb20d46..9306953 100644 --- a/public/serverConfig.json +++ b/public/serverConfig.json @@ -1,5 +1,5 @@ { - "Version": "3.4.5", + "Version": "3.4.6", "Title": "PureAdmin", "FixedHeader": true, "HiddenSideBar": false, diff --git a/src/router/utils.ts b/src/router/utils.ts index 8b21975..62d6bb0 100644 --- a/src/router/utils.ts +++ b/src/router/utils.ts @@ -230,16 +230,21 @@ function addAsyncRoutes(arrRoutes: Array) { // 将backstage属性加入meta,标识此路由为后端返回路由 v.meta.backstage = true; // 父级的redirect属性取值:如果子级存在且父级的redirect属性不存在,默认取第一个子级的path;如果子级存在且父级的redirect属性存在,取存在的redirect属性,会覆盖默认值 - if (v?.children && !v.redirect) v.redirect = v.children[0].path; + if (v?.children && v.children.length && !v.redirect) + v.redirect = v.children[0].path; // 父级的name属性取值:如果子级存在且父级的name属性不存在,默认取第一个子级的name;如果子级存在且父级的name属性存在,取存在的name属性,会覆盖默认值 - if (v?.children && !v.name) v.name = v.children[0].name; - if (v.meta?.frameSrc) v.component = IFrame; - // 对后端传component组件路径和不传做兼容(如果后端传component组件路径,那么path可以随便写,如果不传,component组件路径会跟path保持一致) - const index = v?.component - ? modulesRoutesKeys.findIndex(ev => ev.includes(v.component as any)) - : modulesRoutesKeys.findIndex(ev => ev.includes(v.path)); - v.component = modulesRoutes[modulesRoutesKeys[index]]; - if (v.children) { + if (v?.children && v.children.length && !v.name) + v.name = v.children[0].name; + if (v.meta?.frameSrc) { + v.component = IFrame; + } else { + // 对后端传component组件路径和不传做兼容(如果后端传component组件路径,那么path可以随便写,如果不传,component组件路径会跟path保持一致) + const index = v?.component + ? modulesRoutesKeys.findIndex(ev => ev.includes(v.component as any)) + : modulesRoutesKeys.findIndex(ev => ev.includes(v.path)); + v.component = modulesRoutes[modulesRoutesKeys[index]]; + } + if (v?.children && v.children.length) { addAsyncRoutes(v.children); } }); diff --git a/vite.config.ts b/vite.config.ts index 5244c03..538134d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -70,6 +70,8 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => { chunkSizeWarningLimit: 4000 }, define: { + "process.platform": null, + "process.version": null, __INTLIFY_PROD_DEVTOOLS__: false, __APP_INFO__: JSON.stringify(__APP_INFO__) }