周六开始出现大量的不能获取用户信息授权,同时获取用户信息和地理位置,有户信息授权框一闪而过,只出现地理位置授权,之前没有这些问题,这几天大量出现,还出现未使用你的任何信息这个提示页面,因为不授权不能使用,所以这个问题造成很大困扰
onLoad: function(e) {
var that = this
if (getApp().globalData.hasLogin === false) {
wx.login({
success: function(loginres) {
_getInit(loginres)
}
})
}
function _getInit(loginres){
_getUserInfo(loginres)
_getUserLocation()
}
function _getUserInfo(loginres) {
wx.getUserInfo({
success: function (res) {
wx.request({
url: ‘https://…’+getApp().globalData.auth,
header: {
‘content-type’: ‘application/json’
},
data: {
nickName: res.userInfo.nickName,
gender: res.userInfo.gender,
language: res.userInfo.language,
city: res.userInfo.city,
province: res.userInfo.province,
country: res.userInfo.country,
avatarUrl: res.userInfo.avatarUrl,
code: loginres.code
},
method: ‘POST’,
success: function(result) {
// console.log(result)
getApp().globalData.hasUserInfo=true
getApp().globalData.userInfo=result.data
// console.log(result.data.id)
that.setData({
user: result.data.id
})
}
})
},
})
}
function _getUserLocation(){
wx.getLocation({
type: ‘wgs84’,
success: function(res) {
var latitude = res.latitude
var longitude = res.longitude
var speed = res.speed
var accuracy = res.accuracy
getApp().globalData.hasUserLocation=true,
getApp().globalData.UserLocation=res
wx.request({
url:‘https://…’+ getApp().globalData.auth,
header: {
‘content-type’: ‘application/json’
},
data: {
latitude: latitude,
longitude: longitude,
accuracy: accuracy
},
method: ‘POST’,
success: function (result) {
// console.log(result)
}
})
},
fail:function(res){
},
complete: function(res){
// console.log(res)
}
})
}
},
出现问题流程:扫描二维码进入页面,只弹出地理位置授权,删除小程序,再扫二维码,之前页面获取到的接口信息也不显示,还是只弹出地理位置授权