微信小程序授权及回调
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 }); } }) } }
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

