在app.js中的onLaunch中调用,本地IDE测试正常,在IOS中预览无法调用wx.getSetting函数。
getUserInfo: function () {
var that = this
wx.getSetting({
success: (data) => {
console.log(data)
if (data.authSetting["scope.userInfo"]) {
wx.getUserInfo({
success: function (res) {
console.log(res)
that.globalData.userInfo = res.userInfo
}
})
}
}
})
},
本文网址:http://www.91bianli.com/weixinxiaochengxu/21739.html