引入组件::::<daxiang-getUserProfile ref="getUserProfile"></daxiang-getUserProfile>
调用:::
this.$refs.getUserProfile.open({
desc: '授权登录',
success: e => {
console.log(e)
this.$request('/api/Member/syncUserInfo', 'POST', {
nick_name: e.userInfo.nickName,
avatar: e.userInfo.avatarUrl
}).then(res => {
if (res.status == 200) {
res.data.token = this.$store.state.token
uni.setStorageSync('userInfo', res.data)
this.$store.commit('syncUserInfo', res.data);
this.$failToast('登录成功', 'success')
}
})
},
fail: err => {
console.log(err)
}
});