|
@@ -17,12 +17,14 @@ router.beforeEach(async(to, from, next) => {
|
|
|
// set page title
|
|
|
document.title = getPageTitle(to.meta.title)
|
|
|
|
|
|
- // determine whether the user has logged in
|
|
|
+ // if the query has token, need resave this token and replace the route
|
|
|
if (to.query.token) {
|
|
|
store.commit('user/SET_TOKEN', to.query.token)
|
|
|
delete to.query.token
|
|
|
next({ ...to })
|
|
|
}
|
|
|
+
|
|
|
+ // determine whether the user has logged in
|
|
|
const hasToken = getToken()
|
|
|
|
|
|
if (hasToken) {
|