[AI Generated]: fix(Comp): 修复 OTA 回调参数判断逻辑,以 status==0 为成功条件
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
"style": "v2",
|
||||
"plugins": {
|
||||
"ppScale-plugin": {
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.23",
|
||||
"provider": "wx0826af4e4908f524"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -19,16 +19,15 @@ Component({
|
||||
this._otaCompleted = false;
|
||||
|
||||
// status: false = 成功,true = 失败
|
||||
activeProtocol.codeOtaUpdate((_res, status) => {
|
||||
console.log('OTA status 回调:', status);
|
||||
activeProtocol.codeOtaUpdate((status) => {
|
||||
// 延迟 3 秒,让 Loading 多转一会再收口
|
||||
setTimeout(() => {
|
||||
if (status) {
|
||||
// status true → 升级失败
|
||||
this._finish(false, '固件升级失败');
|
||||
} else {
|
||||
if (status == 0) {
|
||||
// status false → 升级成功
|
||||
this._finish(true);
|
||||
} else {
|
||||
// status true → 升级失败
|
||||
this._finish(false, '固件升级失败');
|
||||
}
|
||||
}, 3000);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user