sunChengjie 11 months ago
parent
commit
105ee0bbe5
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/main.js

+ 3 - 2
src/main.js

@@ -57,9 +57,10 @@ let overallExample = new Vue({
 	template: '<App/>',
 
 })
-
+const whiteList = ['/Login']
 router.beforeEach((to, from, next) => {
-	if (to.matched.some(record => record.meta.needLogin)) { // 判断该路由是否需要登录权限
+	// if (to.matched.some(record => record.meta.needLogin)) { // 判断该路由是否需要登录权限
+	if (!whiteList.includes(to.path)) {
 		console.log('有登录权限')
 		//登录判断
 		if (!localStorage.getItem('userId')) { // 判断当前用户的登录信息userId是否存在