收藏
回答

getUserInfo的openId和unionId值为undefined

问题模块
API和组件

wx.login({

success: function () {

wx.getUserInfo({

success: function (res) {

console.log("==============wxlogin userInfo=" + res.userInfo);

wx.request({

url: 'https://xxxxxx.com/xxxx',

method: 'GET',

data: {

openid: res.userInfo.openId,

nickname: res.userInfo.nickName,

gender: res.userInfo.gender,

city: res.userInfo.city,

province: res.userInfo.province,

country: res.userInfo.country,

avatarurl: res.userInfo.avatarUrl,

unionid: res.userInfo.unionId

},

header: {

'Accept': 'application/json'

},

success: function (res) {

console.log(res);

}

});

}

});


最后一次编辑于  2017-09-18  (未经腾讯允许,不得转载)
邀请回答
复制链接收藏关注问题回答

2 个回答