[AI Generated]: fix(*): 修复蓝牙权限授权、bus订阅泄漏、OTA重复回调、WiFi列表容错及用户同步字段映射问题
This commit is contained in:
@@ -45,6 +45,9 @@ Component({
|
||||
|
||||
wx.showLoading({ title: '正在升级...', mask: true });
|
||||
|
||||
// 重置完成标志位,防止超时与回调重复触发
|
||||
this._otaCompleted = false;
|
||||
|
||||
this.setData({
|
||||
otaProgress: 0,
|
||||
otaStatus: 'upgrading',
|
||||
@@ -62,6 +65,9 @@ Component({
|
||||
activeProtocol.codeOtaUpdate((res) => {
|
||||
console.log('OTA 升级回调:', res);
|
||||
|
||||
// 已完成(成功或失败)则忽略后续回调
|
||||
if (this._otaCompleted) return;
|
||||
|
||||
if (res && res.progress !== undefined) {
|
||||
this.setData({
|
||||
otaProgress: res.progress,
|
||||
@@ -81,6 +87,8 @@ Component({
|
||||
|
||||
// OTA 升级成功处理
|
||||
handleOtaSuccess() {
|
||||
if (this._otaCompleted) return;
|
||||
this._otaCompleted = true;
|
||||
wx.hideLoading();
|
||||
this.setData({
|
||||
otaProgress: 100,
|
||||
@@ -95,6 +103,8 @@ Component({
|
||||
|
||||
// OTA 升级失败处理
|
||||
handleOtaFailed(msg) {
|
||||
if (this._otaCompleted) return;
|
||||
this._otaCompleted = true;
|
||||
wx.hideLoading();
|
||||
const message = msg || '升级失败,设备即将重启';
|
||||
this.setData({
|
||||
|
||||
Reference in New Issue
Block a user