1. 操作设备时添加定位权限检查
This commit is contained in:
parent
6de8d33322
commit
a686dfad84
@ -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)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user