Przeglądaj źródła

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

xiaoshushu 4 lat temu
rodzic
commit
d294ee8bd1
1 zmienionych plików z 1 dodań i 1 usunięć
  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 = '/'