提交 1129380c 编写于 作者: Mr.奇淼('s avatar Mr.奇淼(

修改前端用户信息修改位置,防止报错

上级 cd44d697
...@@ -37,9 +37,9 @@ export const user = { ...@@ -37,9 +37,9 @@ export const user = {
actions: { actions: {
async LoginIn({ commit }, loginInfo) { async LoginIn({ commit }, loginInfo) {
const res = await login(loginInfo) const res = await login(loginInfo)
commit('setUserInfo', res.data.user)
commit('setToken', res.data.token)
if (res.code == 0) { if (res.code == 0) {
commit('setUserInfo', res.data.user)
commit('setToken', res.data.token)
const redirect = router.history.current.query.redirect const redirect = router.history.current.query.redirect
if (redirect) { if (redirect) {
router.push({ path: redirect }) router.push({ path: redirect })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册