wx.getUserProfile这个为什么不走,也打印不出来结果,直接到fail: 里边
wx.getUserProfile({
desc: '登录',
success: async (res) => {
console.log('res',res)
// 后端接口
this.$H.get('/index.php/Wx/login', {
code: this.code,
// nickname: this.nickname,
// avatar: this.avatarUrl
}).then(res => {
this.user_id = res.data.user_id
})
},
fail: (res) => {
wx.showToast({
title: '授权失败',
icon: 'none'
})
}
});
fail打印errmsg看下