canghailong 5 kuukautta sitten
vanhempi
sitoutus
5bc68c7719
1 muutettua tiedostoa jossa 6 lisäystä ja 6 poistoa
  1. 6 6
      src/router/index.js

+ 6 - 6
src/router/index.js

@@ -80,6 +80,12 @@ router.beforeEach(async (to, from, next) => {
 		next()
 		return false
 	} else {
+		if (!token) {
+			next({
+				path: '/slogin'
+			})
+			return false
+		}
 		if (to.query.token) {
 			afterLogin(to.query.token)
 		} else {
@@ -90,12 +96,6 @@ router.beforeEach(async (to, from, next) => {
 			fullPageTool.check(to)
 		}
 	}
-	if (!token) {
-		next({
-			path: '/slogin'
-		})
-		return false
-	}
 	// 整页路由处理
 	if (to.meta.fullpage) {
 		to.matched = [to.matched[to.matched.length - 1]]