examTeamApp/store/actions.js

20 lines
516 B
JavaScript
Raw Normal View History

2024-05-02 15:59:36 +08:00
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
}
});
}
}