getLocation一直返回fail,开发工具可以正常获取经纬度。一到手机就获取不到?
wx.getLocation({
type: 'gcj02',
altitude: true,
isHighAccuracy: true,
highAccuracyExpireTime: 3000,
success(res) {
console.log(res)
const latitude = res.latitude
const longitude = res.longitude
},
fail:res=>{
console.log("fail",res)
}
})
2 回复
【scope.userLocation】这个配置了吗?参考下https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#permission