We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wx.getUserInfo({ success: res => { // 可以将 res 发送给后台解码出 unionId
var userinfo_get = res.rawData; if(res.rawData.constructor != Object){
console.log("获取的用户信息不是对象,转换"); userinfo_get = JSON.parse(res.rawData); }
app.globalData.userInfo = userinfo_get; that.setData({ userInfo: userinfo_get }); // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 // 所以此处加入 callback 以防止这种情况 if (that.userInfoReadyCallback) { that.userInfoReadyCallback(res) } } })
The text was updated successfully, but these errors were encountered:
No branches or pull requests
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
console.log("获取的用户信息不是对象,转换");
userinfo_get = JSON.parse(res.rawData);
}
The text was updated successfully, but these errors were encountered: