Home > Mobile >  April 13 WeChat old login interface getUserInfo cannot use, change of wx. GetUserProfile, small whit
April 13 WeChat old login interface getUserInfo cannot use, change of wx. GetUserProfile, small whit

Time:04-18

GetUserInfo: function (cb) {
Var that=this
If (this. GlobalData. The userInfo) {
Typeof cb=="function" & amp; & Cb (enclosing globalData. The userInfo)
} else {
//call the login interface
Wx. Login ({
Success: the function (res) {
Var code=res. Code;
//get wx user simple info
Wx. GetUserInfo ({
Success: the function (res) {
That. GlobalData. The userInfo=res. The userInfo
Typeof cb=="function" & amp; & Cb (that globalData. The userInfo);
//get the user sessionKey
//get sessionKey
That. GetUserSessionKey (code);
}
});
}
});
}
},
  • Related