wx.getLocation调用为什么一直fail?



handlePosition() {
wx.getLocation({
type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
success: (res) => {
this.lnglat = {
lng: res.longitude,
lat: res.latitude,
}
this.drawPoint()
this.queryAddress()
}
});
}
扫码的可以调用,但是手机微信里getLocation调用一直fail。在开发者工具中是可以调用成功的。这是为什么?
