瀏覽代碼

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

移除硬编码的测试URL,恢复根据环境变量动态设置API基础URL的逻辑
allen 4 天之前
父節點
當前提交
7f9d58cc0f
共有 1 個文件被更改,包括 5 次插入5 次删除
  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;