소스 검색

三方登陆

canghailong 5 달 전
부모
커밋
5bc68c7719
1개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  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]]