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

修复首次登陆报错问题 白屏问题如果出现请及时iss 感谢

上级 d051f8b1
......@@ -35,6 +35,7 @@ export const router = {
})
asyncRouterHandle(baseRouter)
commit('setAsyncRouter', baseRouter)
return true
}
},
getters: {
......
......@@ -38,18 +38,17 @@ export const user = {
}
},
actions: {
async LoginIn({ commit, dispatch }, loginInfo) {
async LoginIn({ commit }, loginInfo) {
const res = await login(loginInfo)
commit('setUserInfo', res.data.user)
commit('setToken', res.data.token)
commit('setExpiresAt', res.data.expiresAt)
if (res.success) {
await dispatch("SetAsyncRouter")
const redirect = router.history.current.query.redirect
if (redirect) {
router.push({ path: redirect, replace: true })
router.push({ path: redirect })
} else {
router.push({ path: '/layout/dashbord', replace: true })
router.push({ path: '/layout/dashbord' })
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册