Explorar el Código

修复token过期时路由跳转问题

puhui999 hace 1 año
padre
commit
46bf186ecc
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/config/axios/service.ts

+ 2 - 1
src/config/axios/service.ts

@@ -230,7 +230,8 @@ const handleAuthorized = () => {
       wsCache.clear()
       removeToken()
       isRelogin.show = false
-      window.location.href = '/login?redirect=/sso?' + window.location.href.split('?')[1]
+      // 干掉token后再走一次路由让它过router.beforeEach的校验
+      window.location.href = window.location.href
     })
   }
   return Promise.reject(t('sys.api.timeoutMessage'))