...mapMutations('m_user',['updateUserInfo']),
// 获取用户信息
getUserInfop(e) {
uni.getUserProfile({
desc:'业务需要',
success:res => {
console.log(res);
this.updateUserInfo(res.userInfo)
this.getToken(res)
}
})
}
success这个方法不能写成success() {}这种方式,不然指向会是原型链上的方法,会报错如下:
要用箭头函数