升级微信版本8.0.40 之后获地理位置失败 getLocation:fail ?
升级微信版本8.0.40 之后 小程序获取获地理位置失败 getLocation:fail privacy permission is not authorized async function getLocation(parames = {}, isRefresh = false) {
let locationResult = await wx.getLocation(parames).catch((err) => ({ err: 'err', ...err }))
if (locationResult.err === 'err') {
if (locationResult.errMsg == 'getLocation:fail:auth denied' ||
locationResult.errMsg == 'getLocation:fail auth deny' ||
locationResult.errMsg == 'getLocation:fail authorize no response') {
openSettingForLocation(parames).then(()=>{
return Promise.resolve(locationResult)
}).catch(()=>{
return Promise.reject(locationResult)
})
} else {
wx.showModal({
title: '提示',
content: '获取地理位置失败',
icon: 'error',
showCancel: false,
})
return Promise.reject(locationResult)
}
}
}
{"err":"err","errMsg":"getLocation:fail privacy permission is not authorized","errno":104}