小程序官网:https://developers.weixin.qq.com/miniprogram/dev/framework/quickstart/getstart.html
wxml:
<button class="confirm-btn" catchtap="login">授权登录</button>
js:
login:function () {
wx.getUserProfile({
desc:'正在获取',//不写不弹提示框
success:function(res){
console.log('获取成功: ',res)
},
fail:function(err){
console.log("获取失败: ",err)
}
})
}