we.getUserInfo
wx.login({
success: function (e) {
console.log(e)
wx.getUserInfo({
success: function (res) {
var simpleUser = res.userInfo;
console.log(simpleUser.nickName);
},
fail:function(res){
console.log(res)
}
});
},
fail:function(e){
console.log(e)
}
});
输出为:{errMsg: “login:ok”, code: “071C7ucn1AvRqk0rFKdn1l2xcn1C7uct”}和{errMsg: “getUserInfo:fail scope unauthorized”}
2 回复