fix(connectedDevice): 绑定失败读取接口返回的 msg

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
17792275749
2026-09-02 18:29:05 +08:00
co-authored by Claude Opus 4.7
parent 8e3da13d52
commit e595ff9f64
@@ -130,17 +130,17 @@ Page({
})
.catch((err) => {
console.error('[connectedDevice] bindDevice 失败:', err)
this._resetAfterBindFail()
this._resetAfterBindFail(err)
})
},
/** bindDevice 失败后的清理重置:断开连接、清缓存、重置页面状态 */
_resetAfterBindFail() {
_resetAfterBindFail(err?: any) {
leFuService.disconnect()
wx.removeStorageSync('connectDeviceInfo')
scannedDevices = []
this.setData({ status: 'idle', deviceList: [] })
wx.showToast({ title: '绑定失败,请重试', icon: 'none' })
wx.showToast({ title: err?.msg || err?.message || '绑定失败,请重试', icon: 'none' })
},
/** 将所有卡片置为未连接 */