用户授权登录
<button class='bottom' type='primary' open-type="getUserInfo" withCredentials="true" lang="zh_CN" @getuserinfo="wxGetUserInfo">授权登录</button>
wxGetUserInfo(res){
console.log(res)
},
获取用户信息
用户登录之后
// 获取用户信息
wx.getUserInfo({
lang:'zh_CN', // 可以不用,只是为了让其中的部分信息中文化
success: res => {
console.log(res.userInfo);
}
})
用户手机号码
https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html
个人appid的不能用啊,别说不行
<button class='bottom' type='primary' open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">获取手机号</button>
wxGetUserInfo(res){
console.log(res)
},