luolei 4 роки тому
батько
коміт
e985f7649b
1 змінених файлів з 18 додано та 1 видалено
  1. 18 1
      src/utils/config.js

+ 18 - 1
src/utils/config.js

@@ -1,5 +1,8 @@
 // const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
+
+const { func } = require("prop-types");
+
 // const host='http://192.168.2.121:5050';//后端接口访问地址
 const host='http://192.168.2.241:6060';//后端接口访问地址
 // const host='http://192.168.2.241:5050';//后端接口访问地址
@@ -8,11 +11,25 @@ const host='http://192.168.2.241:6060';//后端接口访问地址
 // const host='http://192.168.3.117:5050'; //周铁刚
 // const newIcssVisitUrl = '223.93.170.82:13000';    //icss服务访问地址(跳转目的地),不能加http://
 const imageUrlPrefix = 'http://192.168.2.241:82';
+function geturl(){
+    if(window.location.href.indexOf('localhost')>-1){
+        return 'http://localhost:8080/cdss.html'
+    }else if(window.location.href.indexOf('192.168.2.241')>-1){
+        return 'http://192.168.2.241:5654/cdss.html'
+    }else if(window.location.href.indexOf('192.168.2.121')>-1){
+        return 'http://192.168.2.121:5654/cdss.html'
+    }else if(window.location.href.indexOf('192.168.2.122')>-1){
+        return 'http://192.168.2.122:5654/cdss.html'
+    }else{
+        return 'http://192.168.2.241:5654/cdss.html'
+    }
+}
+let gourl = geturl()
 module.exports={
     host,
     prefix:'',            //带权限验证的api
     pushPage:'http://192.168.2.241:5488/icssIndex.html',        //右侧推送页面的地址
     imageUrlPrefix,
-    pushPage2:'http://192.168.2.241:5654/cdss.html',        //右侧推送页面的地址
+    pushPage2:gourl,        //右侧推送页面的地址
     // pushPage2:'http://localhost:8080/cdss.html',        //右侧推送页面的地址
 };