Explorar o código

通过用户访问url,判断后端接口地址

huangguoce hai 1 día
pai
achega
38b53a4e8c
Modificáronse 1 ficheiros con 12 adicións e 2 borrados
  1. 12 2
      config.js

+ 12 - 2
config.js

@@ -5,8 +5,18 @@ if (process.env.NODE_ENV === "development") {
 } else {
   // 生产环境
   //APP_SERVER_URL = 'http://cloud.jeeplus.org/api'
-  //APP_SERVER_URL = 'http://192.168.2.131/api'
-  APP_SERVER_URL = "http://cpaoa.xgccpm.com/api";
+  // APP_SERVER_URL = 'http://192.168.2.131/api'
+  // APP_SERVER_URL = "http://cpaoa.xgccpm.com/api";
+    const host = window.location.hostname;
+    if (host === "xxx.com") {
+      APP_SERVER_URL = "https://xxx.com/api";
+    } else if (host === "xxx.com") {
+      APP_SERVER_URL = "https://xxx.com/api";
+    } else if (host === "xxx.com") {
+      APP_SERVER_URL = "https://xxx.com/api";
+    } else if (host === "xxx.com") {
+      APP_SERVER_URL = "https://xxx.com/api";
+    }
 }
 
 APP_SERVER_URL = APP_SERVER_URL;