html页面
<
button
open-type=
"getUserInfo"
bindgetuserinfo=
"bindGetUserInfo">授权登录
</
button
>
js页面
bindGetUserInfo:
function (e) {
var that =
this;
console.log(e.detail.userInfo)
if (e.detail.userInfo) {
console.log(
'000')
//用户按了允许授权按钮
wx.showModal({
content:
"授权成功,第一次登陆请先修改个人信息",
showCancel:
false,
confirmText:
'知道了',
success:
function (res) {
wx.switchTab({
url:
'../my/my',
})
}
})
}
else {
wx.showModal({
content:
"您已拒绝授权",
showCancel:
false,
confirmText:
'知道了',
success:
function (res) {
that.setData({
showModal2:
false
});
}
})
}
}