Sfoglia il codice sorgente

fix(api): 修复开发环境和生产环境的API基础URL配置

移除硬编码的测试URL,恢复根据环境变量动态设置API基础URL的逻辑
allen 4 giorni fa
parent
commit
7f9d58cc0f
1 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. 5 5
      util/api.js

+ 5 - 5
util/api.js

@@ -4,12 +4,12 @@ export const myRequest = (options) => {
   let BASE_URL = uni.getStorageSync('http');
   console.log(BASE_URL, 'my request', process.env.NODE_ENV);
   if (BASE_URL == '') {
-    // BASE_URL =
-    //   process.env.NODE_ENV === 'development'
-    //     ? 'https://uat.hnyfwlw.com'
-    //     : 'https://web.hnyfwlw.com';
+    BASE_URL =
+      process.env.NODE_ENV === 'development'
+        ? 'https://uat.hnyfwlw.com'
+        : 'https://web.hnyfwlw.com';
     // BASE_URL = 'http://192.168.1.107:8000'
-    BASE_URL = 'http://218.28.198.186:10508';
+    // BASE_URL = 'http://218.28.198.186:10508';
     // BASE_URL = 'http://8.136.98.49:8002';
   }
   // BASE_URL = config.productAPI;