zhb 1 month ago
parent
commit
f2979bc588
2 changed files with 17 additions and 15 deletions
  1. 16 12
      config/index.ts
  2. 1 3
      manifest.json

+ 16 - 12
config/index.ts

@@ -1,30 +1,34 @@
 // #ifdef H5
 let ht = window.location.protocol;
-let ho = window.location.host.split('.')[1];
+let hostParts = window.location.host.split('.');
+let ho = hostParts[hostParts.length - 2]; // 主域名
+let dt = hostParts[hostParts.length - 1]; // 域名后缀
+console.log(ho, dt, ht, 1009);
 ht = ht == 'http:' ? 'https:' : ht;
 ho = ho == '168' ? '44a5c8109e4' : ho;
 // #else
 let ht = 'https:';
 let ho = '44a5c8109e4'; // 默认主域名或可根据实际APP环境配置
+let dt = 'com'; // 默认域名后缀
 // #endif
 
 const config = {
 
-  HostWs: "wss://ws." + ho + ".com",
-  Host80: ht + "//secure." + ho + ".com",
-  Host00: ht + "//ucard." + ho + ".com",
-  Host85: ht + "//ucard." + ho + ".com",
-  Host04: ht + "//pay." + ho + ".com",
+  HostWs: "wss://ws." + ho + "." + dt,
+  Host80: ht + "//secure." + ho + "." + dt,
+  Host00: ht + "//ucard." + ho + "." + dt,
+  Host85: ht + "//ucard." + ho + "." + dt,
+  Host04: ht + "//pay." + ho + "." + dt,
   // Host80: 'http://192.168.0.21:8000',
   // Host00: 'http://192.168.0.21:8000',
   // Host85: 'http://192.168.0.21:8000',
   // Host04: 'http://192.168.0.21:8004',
-  Host90: ht + "//data." + ho + ".com",
-  HostShop: ht + "//shopcustom." + ho + ".com",
-  HostShopImg: ht + "//shopmanager." + ho + ".com",
-  Host87: ht + "//followup." + ho + ".com",
-  Host05: ht + "//file." + ho + ".com",
-  HostEnter: ht + "//ad." + ho + ".com",
+  Host90: ht + "//data." + ho + "." + dt,
+  HostShop: ht + "//shopcustom." + ho + "." + dt,
+  HostShopImg: ht + "//shopmanager." + ho + "." + dt,
+  Host87: ht + "//followup." + ho + "." + dt,
+  Host05: ht + "//file." + ho + "." + dt,
+  HostEnter: ht + "//ad." + ho + "." + dt,
   ho,
   host: ho,
   Code: {

+ 1 - 3
manifest.json

@@ -185,7 +185,7 @@
         "template" : "template.h5.html",
         "router" : {
             "mode" : "hash",
-            "base" : "/web/"
+            "base" : "/vu/"
         },
         "sdkConfigs" : {
             "maps" : {
@@ -195,8 +195,6 @@
             }
         },
         "async" : {
-            "delay": 0,
-            "loading": "",
             "timeout" : 20000
         },
         "uniStatistics" : {