Browse Source

接口地址判断

xiaohaizhao 1 year ago
parent
commit
30be87e0c8
1 changed files with 8 additions and 2 deletions
  1. 8 2
      utils/Http.js

+ 8 - 2
utils/Http.js

@@ -1,7 +1,13 @@
 class HTTP {
     constructor() {
-        // this.baseUrl = "http://61.164.207.46:8000";
-        this.baseUrl = "https://oms.idcgroup.com.cn:8079";
+        let ENV = wx.getAccountInfoSync().miniProgram.envVersion;
+        // ENV = 'release';
+        if (ENV === 'release') { // 正式版
+            this.baseUrl = "https://oms.idcgroup.com.cn:8079";
+        } else {
+            this.baseUrl = "http://61.164.207.46:8000";
+        }
+        console.log("接口地址:", this.baseUrl)
     }
     request({
         url,