https://developers.weixin.qq.com/community/develop/doc/000aee01f98fc0cbd4b6ce43b56c01
使用 button 组件,并将 open-type 指定为 getUserInfo 类型,用户允许授权后,可获取用户基本信息。
<button open-type="getUserInfo" lang="zh_CN" bindgetuserinfo="onGotUserInfo">
获取用户信息
</button>
//登录授权s
wx.login({
success: function (res) {
app.globalData.loginCode = res.code
wx.getUserInfo({
success: function (res) {
app.globalData.userInfo = res.userInfo;
app.globalData.iv = res.iv;
app.globalData.encryptedData = res.encryptedData;
console.log("login3........");
let sessionId = wx.getStorageSync('sessionId');
var sessionKey = "";
//SSS
///EEE
}
})
}
})
//登录授权e