配置高德key,询问时运行能正常通过success获取到定位数据,但是拒绝后,不论success,fail,complete函数都没有进去,包括使用try在外围包起来也捕获不到,直接报错
我的代码
uni.getLocation({
type: 'gcj02',
success: (res) => {
console.log(res)
},
fail: (err) => {
console.log(2)
this.LocationInfo.err = true
},
complete:()=>{
console.log(3)
}
});
报错代码
:20401 Uncaught (in promise) Error: Geolocation permission denied.Get ipLocation failed.
at r.<anonymous> (chunk-vendors.js:20401:7649)
at r.eval (eval at nS (maps?v=2.0&key=我的高德key&callback=__map_callback__AMap:1:188836), <anonymous>:1:20986)
at f (eval at nS (maps?v=2.0&key=我的高德key&callback=__map_callback__AMap:1:188836), <anonymous>:1:2520)
at u._invoke (eval at nS (maps?v=2.0&key=我的高德key&callback=__map_callback__AMap:1:188836), <anonymous>:1:2315)
at t.<computed> [as next] (eval at nS (maps?v=2.0&key=我的高德key&callback=__map_callback__AMap:1:188836), <anonymous>:1:2942)
at h (eval at nS (maps?v=2.0&key=我的高德key&callback=__map_callback__AMap:1:188836), <anonymous>:1:7821)
at r (eval at nS (maps?v=2.0&key=我的高德key&callback=__map_callback__AMap:1:188836), <anonymous>:1:8027)
(匿名) @ chunk-vendors.js:20401
e
1***@qq.com
我的是最新正式版也是这个问题啊 请问官方在解决这个问题么
2023-05-06 12:33
DCloud_UNI_WZF
回复 1***@qq.com: 更到最新 alpha
2023-05-06 13:24
2***@qq.com
回复 DCloud_UNI_WZF: alpha是实验版本,生产环境敢用吗
2023-05-10 14:48