小程序
小游戏
企业微信
微信支付
扫描小程序码分享
手机关闭定位后,安卓wx.getLocation获取地理位置不会走fail。但是ios会走,现在安卓机wx.getLocation没办法抓捕异常。
2 个回答
配合 老张写的 然后加上下边的判断
https://developers.weixin.qq.com/miniprogram/dev/api/base/system/system-info/wx.getSystemInfoSync.html
内容中可能包含密钥、AppSecret等私密参数,泄漏会有安全风险,请检查内容并确认。
wx.getSetting({
success(res) {
if
(!res.authSetting[
"scope.userLocation"
]) wx.navigateTo({
url:
'thepage'
,
})
}
配合 老张写的 然后加上下边的判断
https://developers.weixin.qq.com/miniprogram/dev/api/base/system/system-info/wx.getSystemInfoSync.html
wx.getSetting({
success(res) {
if
(!res.authSetting[
"scope.userLocation"
]) wx.navigateTo({
url:
'thepage'
,
})
}
})