为什么wx.login调用后点击拒绝进入成功同意的回调?
通过按钮open-type"getUserInfo"调用wx.login后 点击拒绝,进入的是同意的回调
附上代码
<button class='btn-wx' disabled="{{!agree}}" open-type="getUserInfo" bindgetuserinfo="handleLogin">微信一键登陆</button>
// 微信登录获取code
handleLogin: function() {
if (this.data.agree) {
let that = this
// 登录
wx.login({
success: res => {
console.log(res)
that.setData({
code: res.code
})
that.getOpenIdAndUnionId()
},
fail: err => {
console.log(err)
},
})
}
},
附上回调参数
{errMsg: "login:ok", code: "xxxxxxxxxxxxxxxx"}