Quellcode durchsuchen

fix: 平板扫码功能

chenzhen2 vor 2 Jahren
Ursprung
Commit
271afbd349
2 geänderte Dateien mit 14 neuen und 4 gelöschten Zeilen
  1. 7 2
      pages/adjust/index.js
  2. 7 2
      pages/index/index.js

+ 7 - 2
pages/adjust/index.js

@@ -227,9 +227,14 @@ Page({
             spaceId: this.data.spaceDetail.id
         }
         comfirmCodeLogin(param).then(res => {
-            router.push("ipdauth", { 'id': id, 'mac': mac, spaceId: this.data.spaceDetail.id })
+            if(res.result==='success'){
+                router.push("ipdauth", { 'id': id, 'mac': mac, spaceId: this.data.spaceDetail.id })
+            }else{
+                Toast.fail(res.message);
+            }
         }).catch(() => {
-            router.push("ipdauth", { 'id': id, 'mac': mac, spaceId: this.data.spaceDetail.id })
+            Toast.fail("无效的二维码");
+            // router.push("ipdauth", { 'id': id, 'mac': mac, spaceId: this.data.spaceDetail.id })
         })
     },
     changeMode() {

+ 7 - 2
pages/index/index.js

@@ -556,9 +556,14 @@ Page({
             projectId: projectId
         }
         comfirmCodeLogin(param).then(res => {
-            router.push("ipdauth", { 'id': id, 'mac': mac })
+            if(res.result==='success'){
+                router.push("ipdauth", { 'id': id, 'mac': mac })
+            }else{
+                Toast.fail(res.message);
+            }
         }).catch(() => {
-            router.push("ipdauth", { 'id': id, 'mac': mac })
+            Toast.fail("无效的二维码");
+            // router.push("ipdauth", { 'id': id, 'mac': mac })
         })
     },
     async userLogin() {