소스 검색

优化关闭浏览器时重新打开未跳转登陆问题

xiaoshushu 4 년 전
부모
커밋
d294ee8bd1
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/router/index.js

+ 1 - 1
src/router/index.js

@@ -73,7 +73,7 @@ const router =  new Router({
 
 // vue  路由全局拦截器
 router.beforeEach(function (to, from, next) {
-  let token = localStorage.getItem('front-token')
+  let token = sessionStorage.getItem('entranceExamFlag')
   if (to.path === '/login') {
     if (token) {
       location.href = '/'