Merge branch 'fanpeng' into 'develop'

feat: 增强蓝牙连接逻辑,针对不同平台添加超时处理,优化重连机制

See merge request StarlockTeam/wx-starlock!50
This commit is contained in:
范鹏 2025-07-12 03:27:37 +00:00
commit 06d571b257

View File

@ -1041,12 +1041,20 @@ export const useBluetoothStore = defineStore('ble', {
resolve(true)
return
}
// #ifdef MP
if (res.errno === 1509001 && number < 1) {
// 超时直接返回
resolve(false)
return
}
// #endif
// #ifdef APP-PLUS
if (res.code === 10012 && number < 1) {
// 超时直接返回
resolve(false)
return
}
// #endif
if (number < 1) {
// 重新连接
resolve(await that.connectBluetoothDevice(number + 1))
@ -1440,7 +1448,7 @@ export const useBluetoothStore = defineStore('ble', {
}
})
},
(i + 1) * 200
(i + 1) * 250
)
// #endif