From f747ec113187292d939506c2c577f1f99467bc1c Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 25 Aug 2021 13:09:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=EF=BC=8C=E8=B7=AF=E7=94=B1=E5=88=A4=E6=96=AD=EF=BC=88?= =?UTF-8?q?=E8=81=8C=E7=AB=99=E6=B5=8B=E8=AF=95=E6=9C=8D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/index.js | 22 ++++++++++++++++++++-- src/views/Home.vue | 14 ++++---------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/config/index.js b/src/config/index.js index 800d14f..b75fe89 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -1,13 +1,31 @@ const isHh = location.host.includes('10.196.131.73') //是否是河海版本 +const isBeta = process.env.NODE_ENV === 'development' || location.host.includes('120.78.198.231') //是否是职站测试 +const isPro = location.host.includes('occupationlab.com') //是否是职站生产 + +let host = ""; +if(isHh) { + host = "http://10.196.131.73/"; +} else if(isBeta) { + host = "http://120.78.198.231:8081/"; +} else if(isPro) { + host = "http://www.occupationlab.com/"; +} else { + console.log("其它"); +} + export default { /** - * @description 域名切换,120.78.198.231:职站测试环境,occupationlab.com:职站正式环境,10.196.131.73:河海版本 + * @description 域名切换 */ - host: (process.env.NODE_ENV === 'development' || location.host.includes('120.78.198.231')) ? 'http://120.78.198.231:8081/' : (location.host.includes('10.196.131.73') ? 'http://10.196.131.73/' : 'http://www.occupationlab.com/'), + host, /** * @description 是否是河海版本 */ isHh, + /** + * @description 是否是开发/测试版本 + */ + isBeta, /** * @description 配置显示在浏览器标签的title */ diff --git a/src/views/Home.vue b/src/views/Home.vue index 98a17af..3f8f1d6 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -189,22 +189,16 @@ export default { this.leavePage() if(this.projectPermissions){ // 返回到考核列表 - if(location.host.includes('10.196.131.73')) { // 判断是否是河海 + if (this.$config.isBeta) { // 判断是否是职站测试服 location.href = `http://120.78.198.231/#/ass/list` - } else if (location.host.includes('120.78.198.231')) { // 判断是否是职站测试服 - location.href = `http://120.78.198.231/#/ass/list` - } else { - location.href = `http://www.occupationlab.com/#/ass/list` } + location.href = `${this.$config.host}#/dashboard#2` }else{ // 返回到实验台 - if(location.host.includes('10.196.131.73')) { - location.href = `http://120.78.198.231/#/ass/list` - } else if (location.host.includes('120.78.198.231')) { + if (this.$config.isBeta) { location.href = `http://120.78.198.231/#/station/list` - } else { - location.href = `http://www.occupationlab.com/#/station/list` } + location.href = `${this.$config.host}#/dashboard#1` } this.$refs.mainindex.getClearTime(); },