From c6b7c64a21ff85fe5c4bc6eaf8df66e18291bb4b Mon Sep 17 00:00:00 2001 From: yinsiyu <516159562@qq.com> Date: Thu, 29 Aug 2024 15:58:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 3 +++ .env.production | 3 +++ package.json | 3 ++- src/router/admin.js | 2 +- src/store/modules/permission.js | 6 +++++- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.env.development b/.env.development index 6a56991..8db948b 100644 --- a/.env.development +++ b/.env.development @@ -10,3 +10,6 @@ VUE_APP_BASE_PATH = '/sf-admin/' VUE_APP_SURVEY_PREFIX = /dw # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true + +# 神火医院定制化 +VUE_APP_SHEN_HUO_CLIENTID = "2015112716143758"; diff --git a/.env.production b/.env.production index df3e590..598d786 100644 --- a/.env.production +++ b/.env.production @@ -9,3 +9,6 @@ VUE_APP_BASE_PATH = /sf-admin/ VUE_APP_ADMIN_LOGIN_URL = /hisca/#/sub-login VUE_APP_ADMIN_HOME_URL = /hisca/ VUE_APP_SURVEY_PREFIX = /dw + +# 神火医院定制化 +VUE_APP_SHEN_HUO_CLIENTID = "2024060415545011"; diff --git a/package.json b/package.json index a4fe7c9..4da0882 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "author": "", "license": "MIT", "scripts": { - "dev": "vue-cli-service serve", + "dev": "vue-cli-service serve --mode development", + "build:dev": "vue-cli-service build --mode development", "build": "vue-cli-service build --mode production", "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview", diff --git a/src/router/admin.js b/src/router/admin.js index 6b079e3..df9af6e 100644 --- a/src/router/admin.js +++ b/src/router/admin.js @@ -117,7 +117,7 @@ export const dynamicRoutes = [ path: "therapeuticRegimen", hidden: false, component: () => import("@/views/dictManage/therapeuticRegimen/list"), - // permissions: ["820004"], + clientId: [process.env.VUE_APP_SHEN_HUO_CLIENTID], // 只有神火有该权限 meta: { title: "治疗方案维护", noCache: false, diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 5312670..a9cfc0c 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -1,5 +1,6 @@ import auth from "@/plugins/auth"; import router, { constantRoutes, dynamicRoutes } from "@/router"; +import { getClientId } from "@/utils/auth"; const permission = { state: { routes: [], @@ -45,7 +46,10 @@ export function filterDynamicRoutes(routes) { ...route, children: route.children ? filterDynamicRoutes(route.children) : [], }; - if (auth.hasPermiOr(temp.permissions)) { + if ( + (auth.hasPermiOr(temp.permissions) && !temp.clientId) || + temp.clientId?.includes(getClientId()) + ) { res.push(temp); } });