[AI Generated]: refactor(Comp): 移除配网超时机制、工号输入满8位自动查询用户
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
const app = getApp();
|
||||
|
||||
// 超时时间:15 秒
|
||||
const SDK_TIMEOUT = 15000;
|
||||
|
||||
Component({
|
||||
data: {
|
||||
progress: 0,
|
||||
@@ -20,7 +17,6 @@ Component({
|
||||
},
|
||||
detached() {
|
||||
console.log('configureDevice3 detached');
|
||||
if (this._sdkCancel) { this._sdkCancel(); this._sdkCancel = null; }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -84,42 +80,26 @@ Component({
|
||||
|
||||
let version = app.globalData.ppScale.version;
|
||||
if (version === 'domain1') {
|
||||
this._sdkCancel = app.callWithTimeout(
|
||||
(done) => app.globalData.ppScale.activeProtocol.dataConfigNetWork({
|
||||
domain: app.globalData.ppScale.domain1,
|
||||
ssid: this.data.selectWifi.ssid,
|
||||
password: this.data.selectWifiPWD
|
||||
}, done),
|
||||
SDK_TIMEOUT,
|
||||
(res) => {
|
||||
console.log("setNetwork.js dataConfigNetWork 1", res);
|
||||
this.netWorkCallBack(res);
|
||||
},
|
||||
() => {
|
||||
this.setData({ progress: 1 });
|
||||
wx.showToast({ title: "配网超时,请重试", icon: "none" });
|
||||
}
|
||||
);
|
||||
app.globalData.ppScale.activeProtocol.dataConfigNetWork({
|
||||
domain: app.globalData.ppScale.domain1,
|
||||
ssid: this.data.selectWifi.ssid,
|
||||
password: this.data.selectWifiPWD
|
||||
}, (res) => {
|
||||
console.log("setNetwork.js dataConfigNetWork 1", res);
|
||||
this.netWorkCallBack(res);
|
||||
});
|
||||
}
|
||||
if (version === 'domain2') {
|
||||
this._sdkCancel = app.callWithTimeout(
|
||||
(done) => app.globalData.ppScale.activeProtocol.dataConfigUserNetWork({
|
||||
domain: app.globalData.ppScale.domain2,
|
||||
ssid: this.data.selectWifi.ssid,
|
||||
password: this.data.selectWifiPWD,
|
||||
userName: "apiUser",
|
||||
userPassword: "3acebb95eb49577e9c2a2082589b9bd6",
|
||||
}, done),
|
||||
SDK_TIMEOUT,
|
||||
(res) => {
|
||||
console.log("setNetwork.js dataConfigUserNetWork 2", res);
|
||||
this.netWorkCallBack(res);
|
||||
},
|
||||
() => {
|
||||
this.setData({ progress: 1 });
|
||||
wx.showToast({ title: "配网超时,请重试", icon: "none" });
|
||||
}
|
||||
);
|
||||
app.globalData.ppScale.activeProtocol.dataConfigUserNetWork({
|
||||
domain: app.globalData.ppScale.domain2,
|
||||
ssid: this.data.selectWifi.ssid,
|
||||
password: this.data.selectWifiPWD,
|
||||
userName: "apiUser",
|
||||
userPassword: "3acebb95eb49577e9c2a2082589b9bd6",
|
||||
}, (res) => {
|
||||
console.log("setNetwork.js dataConfigUserNetWork 2", res);
|
||||
this.netWorkCallBack(res);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user