Bladeren bron

fix:修改小程序的黑胶,wifi配网可以输入空密码

zeng.chen 5 maanden geleden
bovenliggende
commit
cce113d55f
2 gewijzigde bestanden met toevoegingen van 13 en 12 verwijderingen
  1. 8 9
      pages/deviceConnect1/deviceConnect1.js
  2. 5 3
      pages/setWifi/setWifi.js

+ 8 - 9
pages/deviceConnect1/deviceConnect1.js

@@ -13,7 +13,6 @@ Page({
     is5GWifi: false,
     ssid: "",
     pwdData: "",
-    pwdData1: "",
     connectDevice: "",
   },
 
@@ -112,14 +111,14 @@ Page({
       return;
     };
 
-    if (that.data.pwdData === "") {
-      wx.showToast({
-        title: '请输入WIFI密码',
-        icon: 'none',
-        duration: 2000
-      })
-      return;
-    };
+    // if (that.data.pwdData === "") {
+    //   wx.showToast({
+    //     title: '请输入WIFI密码',
+    //     icon: 'none',
+    //     duration: 2000
+    //   })
+    //   return;
+    // };
 
     app.globalData.ssid = that.data.ssid;
     app.globalData.pwdData = that.data.pwdData;

+ 5 - 3
pages/setWifi/setWifi.js

@@ -31,7 +31,8 @@ Page({
     let wifiDic = store.getStore("wifiInfo")
     let wifiName = wifiDic.wifiName
     let pwd = wifiDic.wifiPassword
-    if (wifiName && pwd) {
+    // if (wifiName && pwd) {
+      if (wifiName) {
       console.log("获取Wi-Fi信息", wifiName, pwd);
       that.setData({
         wifiName: wifiName,
@@ -109,9 +110,10 @@ Page({
   sendWiFiInfo(wifiName, pwd) {
     // [0x22, (wifiList.length + pwdList.length + 6), 0x33, (wifiList.length), (wifiList), 0x44, (pwdList)];
 
-    if (!wifiName || !pwd) {
+    if (!wifiName) {
+      // if (!wifiName || pwd) {
       wx.showToast({
-        title: '请输入正确的账号密码',
+        title: '请输入正确的账号',
       })
       wx.hideLoading()
       return;