From df933b2b0d359913a29be82c8e8c7d031fea6c5b Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 1 Apr 2020 09:25:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=9C=AC=E5=9C=B0=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=9C=AC=E5=9C=B0=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/layout/components/Entry.vue | 2 +- src/permission.js | 2 +- vue.config.js | 4 +--- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.env.development b/.env.development index 73489ea25..8527b4390 100644 --- a/.env.development +++ b/.env.development @@ -1,6 +1,6 @@ # just a flag NODE_ENV = 'development' -#VUE_APP_PRO = 'local' +# VUE_APP_PRO = 'local' # base api # VUE_APP_BASE_API = 'https://joylink.club/jlcloud' diff --git a/src/layout/components/Entry.vue b/src/layout/components/Entry.vue index 0bdab8b7c..cc9188a2d 100644 --- a/src/layout/components/Entry.vue +++ b/src/layout/components/Entry.vue @@ -65,7 +65,7 @@ export default { { name: 'global.scan', handle: this.qcodeEntry, - hidden: process.env.NODE_ENV != 'development' || getSessionStorage('project').startsWith('design') + hidden: process.env.NODE_ENV != 'development' || getSessionStorage('project').startsWith('design') || process.env.VUE_APP_PRO === 'local' }, { name: 'global.quickEntry', diff --git a/src/permission.js b/src/permission.js index 44690ba3b..228986993 100644 --- a/src/permission.js +++ b/src/permission.js @@ -67,7 +67,7 @@ function getRouteInfo(to) { loginPath = loginGzbPage; clientId = null; } else if (/^\/hyd/.test(toRoutePath)) { - if (process.env.NODE_ENV === 'Local') { + if (process.env.VUE_APP_PRO === 'local') { loginPath = loginPage; } else { loginPath = loginHydPage; diff --git a/vue.config.js b/vue.config.js index 561d92480..ec52dd3f0 100644 --- a/vue.config.js +++ b/vue.config.js @@ -93,9 +93,7 @@ module.exports = { '@': path.resolve('src') } }; - // var appTarget = 'Common'; - // var appTarget = 'HYD';// 哈尔滨项目打包 - var appTarget = process.env.NODE_ENV === 'Local' ? 'HYD' : 'Common'; + var appTarget = process.env.NODE_ENV === 'Local' || process.env.VUE_APP_PRO === 'local' ? 'HYD' : 'Common'; config.plugins.push(new webpack.NormalModuleReplacementPlugin(/(.*)_APP_TARGET(\.*)/, function (resourse) { resourse.request = resourse.request.replace(/APP_TARGET/, `${appTarget}`);