|
@@ -32,7 +32,8 @@ router.beforeEach((to, from, next) => {
|
|
store.dispatch('SetInfo', userInfo)
|
|
store.dispatch('SetInfo', userInfo)
|
|
} else {
|
|
} else {
|
|
store.dispatch('Logout').then(() => {
|
|
store.dispatch('Logout').then(() => {
|
|
- next({ path: '/user/login', query: { redirect: to.fullPath } })
|
|
+
|
|
|
|
+ next({ path: '/user/login' })
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
@@ -52,16 +53,17 @@ router.beforeEach((to, from, next) => {
|
|
} else {
|
|
} else {
|
|
store.dispatch('GenerateRoutes', { roles }).then(() => {
|
|
store.dispatch('GenerateRoutes', { roles }).then(() => {
|
|
|
|
|
|
|
|
+ next({ ...to, replace: true })
|
|
|
|
|
|
|
|
|
|
- const redirect = decodeURIComponent(from.query.redirect || to.path)
|
|
+
|
|
- if (to.path === redirect) {
|
|
+
|
|
-
|
|
+
|
|
- next({ ...to, replace: true })
|
|
+
|
|
- } else {
|
|
+
|
|
-
|
|
+
|
|
- next({ path: redirect })
|
|
+
|
|
- }
|
|
+
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|