Преглед на файлове

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

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 = '/'