getUserInfo:function(cb){
var that = this
if(this.globalData.userInfo){
typeof cb == "function" && cb(this.globalData.userInfo)
}else{
//呼叫登錄介面
wx.login({
success: function (res) {
var code = res.code;
//get wx user simple info
wx.getUserInfo({
success: function (res) {
that.globalData.userInfo = res.userInfo
typeof cb == "function" && cb(that.globalData.userInfo);
//get user sessionKey
//get sessionKey
that.getUserSessionKey(code);
}
});
}
});
}
},
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/277216.html
標籤:微信開發
上一篇:微信小程式中字串代碼無法轉義
