[AI Generated]: fix(Comp): 修复 OTA 回调参数判断逻辑,以 status==0 为成功条件

This commit is contained in:
17792275749
2026-04-09 11:07:54 +08:00
parent 8cb7a11fbe
commit 0b3eb25a62
2 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -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);
});