Bläddra i källkod

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

huangguoce 1 dag sedan
förälder
incheckning
38b53a4e8c
1 ändrade filer med 12 tillägg och 2 borttagningar
  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;