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