修复了第一次登录白页的问题 删除了几个空白的文件

This commit is contained in:
pixel
2019-11-07 22:05:41 +08:00
parent 7663b4f3c9
commit 3203f9c965
4 changed files with 105 additions and 104 deletions
+2 -1
View File
@@ -38,12 +38,13 @@ export const user = {
}
},
actions: {
async LoginIn({ commit }, loginInfo) {
async LoginIn({ commit, dispatch }, 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 })