20 lines
516 B
JavaScript
20 lines
516 B
JavaScript
|
|
import model from "../tools/model.js"
|
|||
|
|
import tools from '@/tools/tools.js'
|
|||
|
|
// Action 包含异步操作(请求API方法)、回调函数提交mutaions更改state数据状态,使之可以异步
|
|||
|
|
export default {
|
|||
|
|
// 用户信息
|
|||
|
|
getUserInfo({
|
|||
|
|
commit
|
|||
|
|
},
|
|||
|
|
account) {
|
|||
|
|
return model.getUserInfo(account).then(res => {
|
|||
|
|
commit('changeUser', res.data)
|
|||
|
|
if (!res.data.height || !res.data.mage || !res.data.birthday) {
|
|||
|
|
uni.redirectTo({
|
|||
|
|
url: `/pageTwo/login/userinfo`
|
|||
|
|
})
|
|||
|
|
return
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|