修改项目跳转,路由判断(职站测试服)

master V1.0
yujialong 3 years ago
parent 51023eae3a
commit ca7209ebae
  1. 22
      src/config/index.js
  2. 14
      src/views/Home.vue

@ -1,13 +1,31 @@
const isHh = location.host.includes('10.196.131.73') //是否是河海版本 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 { 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 是否是河海版本 * @description 是否是河海版本
*/ */
isHh, isHh,
/**
* @description 是否是开发/测试版本
*/
isBeta,
/** /**
* @description 配置显示在浏览器标签的title * @description 配置显示在浏览器标签的title
*/ */

@ -190,22 +190,16 @@ export default {
this.leavePage() this.leavePage()
if(this.projectPermissions){ if(this.projectPermissions){
// //
if(location.host.includes('10.196.131.73')) { // if (this.$config.isBeta) { //
location.href = `http://120.78.198.231/#/ass/list` 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{ }else{
// //
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/#/station/list` 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(); this.$refs.mainindex.getClearTime();
}, },

Loading…
Cancel
Save