Forráskód Böngészése

feat: 获取跳转路径防空判断

Damon 9 hónapja
szülő
commit
b06fd0cebf
1 módosított fájl, 42 hozzáadás és 2 törlés
  1. 42 2
      src/pages/public/remote.vue

+ 42 - 2
src/pages/public/remote.vue

@@ -58,11 +58,51 @@ export default {
     },
 
     getSubmit1() {
-      window.location.href = this.flowUrl;
+      if (this.flowUrl.length === 0) {
+        deviceUrlInfo({
+          code: this.state,
+          code: this.openId,
+        }).then((res) => {
+          if (res.code === 0) {
+            this.flowUrl = res.data.flowUrl;
+            this.wifiUrl = res.data.wifiUrl;
+            window.location.href = this.flowUrl;
+          } else {
+            uni.showToast({
+              title: res.message,
+              icon: "none",
+              mask: true,
+              duration: 2000,
+            });
+          }
+        });
+      } else {
+        window.location.href = this.flowUrl;
+      }
     },
 
     getSubmit2() {
-      window.location.href = this.wifiUrl;
+      if (this.wifiUrl.length === 0) {
+        deviceUrlInfo({
+          code: this.state,
+          code: this.openId,
+        }).then((res) => {
+          if (res.code === 0) {
+            this.flowUrl = res.data.flowUrl;
+            this.wifiUrl = res.data.wifiUrl;
+            window.location.href = this.wifiUrl;
+          } else {
+            uni.showToast({
+              title: res.message,
+              icon: "none",
+              mask: true,
+              duration: 2000,
+            });
+          }
+        });
+      } else {
+        window.location.href = this.wifiUrl;
+      }
     },
   },
 };