这是我在使用微信小程序的时候 获取本机地址的时候会出现的这个问题 这个问题很好解决
获取本地定位的代码也很简单
wx.getLocation({// 国内只能使用gcj02坐标系,wgs84不能使用;高德地图等都是使用的gcj02type: "gcj02",success: function (res) {that.setData({latitude: res.latitude,longitude: res.longitude})}})
解决办法
位置授权要先在app.json里声明一下,在app.json中加入以下这段代码
"permission": {"scope.userLocation": {"desc": "山东省济南市历城区"}}