1. 操作设备时添加定位权限检查

This commit is contained in:
范鹏 2024-09-03 11:56:15 +08:00
parent 6de8d33322
commit a686dfad84

View File

@ -772,6 +772,22 @@ export const useBluetoothStore = defineStore('ble', {
// 重新初始化蓝牙适配器
await that.initBluetooth()
that.searchAndConnectDevice()
} else if(res.errno === 1509008) {
uni.showModal({
title: '提示',
content: '安卓手机蓝牙功能需要定位权限,请前往设置开启微信的定位权限后再试',
showCancel: false,
success(res) {
if (res.confirm) {
uni.openAppAuthorizeSetting({
success (res) {
console.log(res)
}
})
}
}
})
resolve(false)
} else {
resolve(false)
}