Selaa lähdekoodia

Merge branch 'develop/3.2.2' into develop/3.2.2_tencent

Damon 9 kuukautta sitten
vanhempi
commit
489a91a928
6 muutettua tiedostoa jossa 57 lisäystä ja 48 poistoa
  1. 1 2
      .env.development
  2. 1 2
      .env.production
  3. 6 6
      src/pages/public/remote.vue
  4. 24 18
      src/pages/public/uuid.vue
  5. 24 18
      src/pages/public/uuidt.vue
  6. 1 2
      vue.config.js

+ 1 - 2
.env.development

@@ -4,5 +4,4 @@ NODE_ENV = development
 VUE_APP_ENV = 'development'
 
 # 开发环境接口
-VUE_APP_BASE_API = 'https://web.ohplay.airsmartser.com/web'
-# VUE_APP_BASE_API = 'https://o3tapi.radio1964.com/web'
+VUE_APP_BASE_API = 'https://o3tapi.radio1964.com/web'

+ 1 - 2
.env.production

@@ -4,5 +4,4 @@ NODE_ENV = production
 VUE_APP_ENV = 'production'
 
 # 生产环境接口
-VUE_APP_BASE_API = 'https://web.ohplay.airsmartser.com/web'
-# VUE_APP_BASE_API = 'https://client.ohplay.radio1964.net/web'
+VUE_APP_BASE_API = 'https://client.ohplay.radio1964.net/web'

+ 6 - 6
src/pages/public/remote.vue

@@ -47,8 +47,8 @@ export default {
     ///获取用户信息
     deviceUrlInfo() {
       deviceUrlInfo({
-        code: this.state,
-        code: this.openId,
+        state: this.state,
+        openId: this.openId,
       }).then((res) => {
         if (res.code === 0) {
           this.flowUrl = res.data.flowUrl;
@@ -60,8 +60,8 @@ export default {
     getSubmit1() {
       if (this.flowUrl.length === 0) {
         deviceUrlInfo({
-          code: this.state,
-          code: this.openId,
+          state: this.state,
+          openId: this.openId,
         }).then((res) => {
           if (res.code === 0) {
             this.flowUrl = res.data.flowUrl;
@@ -84,8 +84,8 @@ export default {
     getSubmit2() {
       if (this.wifiUrl.length === 0) {
         deviceUrlInfo({
-          code: this.state,
-          code: this.openId,
+          state: this.state,
+          openId: this.openId,
         }).then((res) => {
           if (res.code === 0) {
             this.flowUrl = res.data.flowUrl;

+ 24 - 18
src/pages/public/uuid.vue

@@ -45,6 +45,7 @@ export default {
       }).then((res) => {
         if (res.code === 0) {
           this.openId = res.data.openid;
+          this.deviceBindInfo(true);
         }
       });
     },
@@ -60,7 +61,10 @@ export default {
         });
         return;
       }
+      this.deviceBindInfo(false);
+    },
 
+    deviceBindInfo(isInit) {
       deviceBindInfo({
         state: this.state,
         openId: this.openId,
@@ -73,24 +77,26 @@ export default {
               url: `/pages/public/remote?state=${this.state}&openId=${this.openId}`,
             });
           } else {
-            deviceBind({
-              deviceMac: this.inputValue,
-              state: this.state,
-              openId: this.openId,
-            }).then((res) => {
-              if (res.code === 0) {
-                uni.redirectTo({
-                  url: `/pages/public/remote?state=${this.state}&openId=${this.openId}`,
-                });
-              } else {
-                uni.showToast({
-                  title: res.message,
-                  icon: "none",
-                  mask: true,
-                  duration: 2000,
-                });
-              }
-            });
+            if (!isInit) {
+              deviceBind({
+                deviceMac: this.inputValue,
+                state: this.state,
+                openId: this.openId,
+              }).then((res) => {
+                if (res.code === 0) {
+                  uni.redirectTo({
+                    url: `/pages/public/remote?state=${this.state}&openId=${this.openId}`,
+                  });
+                } else {
+                  uni.showToast({
+                    title: res.message,
+                    icon: "none",
+                    mask: true,
+                    duration: 2000,
+                  });
+                }
+              });
+            }
           }
         }
       });

+ 24 - 18
src/pages/public/uuidt.vue

@@ -45,6 +45,7 @@ export default {
       }).then((res) => {
         if (res.code === 0) {
           this.openId = res.data.openid;
+          this.deviceBindInfo(true);
         }
       });
     },
@@ -60,7 +61,10 @@ export default {
         });
         return;
       }
+      this.deviceBindInfo(false);
+    },
 
+    deviceBindInfo(isInit) {
       deviceBindInfo({
         state: this.state,
         openId: this.openId,
@@ -73,24 +77,26 @@ export default {
               url: `/pages/public/remote?state=${this.state}&openId=${this.openId}`,
             });
           } else {
-            deviceBind({
-              deviceMac: this.inputValue,
-              state: this.state,
-              openId: this.openId,
-            }).then((res) => {
-              if (res.code === 0) {
-                uni.redirectTo({
-                  url: `/pages/public/remote?state=${this.state}&openId=${this.openId}`,
-                });
-              } else {
-                uni.showToast({
-                  title: res.message,
-                  icon: "none",
-                  mask: true,
-                  duration: 2000,
-                });
-              }
-            });
+            if (!isInit) {
+              deviceBind({
+                deviceMac: this.inputValue,
+                state: this.state,
+                openId: this.openId,
+              }).then((res) => {
+                if (res.code === 0) {
+                  uni.redirectTo({
+                    url: `/pages/public/remote?state=${this.state}&openId=${this.openId}`,
+                  });
+                } else {
+                  uni.showToast({
+                    title: res.message,
+                    icon: "none",
+                    mask: true,
+                    duration: 2000,
+                  });
+                }
+              });
+            }
           }
         }
       });

+ 1 - 2
vue.config.js

@@ -10,8 +10,7 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `https://web.ohplay.airsmartser.com/web`,
-        // target: `https://o3tapi.radio1964.com/web`,
+        target: `https://o3tapi.radio1964.com/web`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''