examTeamApp/store/actions.js

20 lines
516 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
}
});
}
}