Ver Fonte

三方登陆

canghailong há 5 meses atrás
pai
commit
5bc68c7719
1 ficheiros alterados com 6 adições e 6 exclusões
  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]]