浏览代码

修复发布管理地址

qinzhipeng_v 5 年之前
父节点
当前提交
24035d4cf3
共有 2 个文件被更改,包括 17 次插入3 次删除
  1. 6 1
      src/apiConfig/requestIP.js
  2. 11 2
      src/views/newWeb/index.vue

+ 6 - 1
src/apiConfig/requestIP.js

@@ -2,10 +2,15 @@ export let host = 'http://zhihui-test.intra.xiaojukeji.com'
 export let requestIp = host + '/zuul'
 export let loginUrl = host + '/sso/login?jumpto=' + 'http://zhihui-test.intra.xiaojukeji.com' + location.pathname
 export let logoutUrl = host + '/sso/logout?jumpto=' + 'http://zhihui-test.intra.xiaojukeji.com' + location.pathname
-
+export let envTag = 'test'
 if (location.host.indexOf('localhost') < 0) {
   host = 'http://' + location.host
   requestIp = host + '/zuul'
   loginUrl = host + '/sso/login?jumpto=' + location.href
   logoutUrl = host + '/sso/logout?jumpto=' + location.href
+  if (host.indexOf('zhihui-pre.intra.xiaojukeji.com') >= 0) {
+    envTag = 'pre'
+  } else if (host.indexOf('zhihui.xiaojukeji.com') >= 0) {
+    envTag = 'online'
+  }
 }

+ 11 - 2
src/views/newWeb/index.vue

@@ -5,6 +5,7 @@
 </template>
 
 <script>
+import { envTag } from '@/apiConfig/requestIP.js'
 export default {
   name: 'NEWWEB',
   data() {
@@ -14,9 +15,17 @@ export default {
     }
   },
   computed: {
-    envUrl() {
+    envUrl: () => {
+      return function() {
+        if (envTag === 'test') {
+          return ' http://cp-stable.intra.xiaojukeji.com/project/'
+        }
+        if (envTag === 'pre' || envTag === 'online') {
+          return ' http://cp-pre.intra.xiaojukeji.com/project/'
+        }
+      }
       // return ' http://cp-stable.intra.xiaojukeji.com/project/' // 线下
-      return ' http://cp-pre.intra.xiaojukeji.com/project/' // 线上
+      // return ' http://cp-pre.intra.xiaojukeji.com/project/' // 线上
     }
   },
   mounted() {