登录过期后跳转到过期前页面

This commit is contained in:
不做码农 2023-08-23 18:36:19 +08:00
parent e7fd1cfaa6
commit 761a75ed40

View File

@ -64,8 +64,9 @@ service.interceptors.response.use(
useUserStore() useUserStore()
.logOut() .logOut()
.then(() => { .then(() => {
var redirectUrl = window.location.pathname
if (location.pathname.indexOf('/login') != 0) { if (location.pathname.indexOf('/login') != 0) {
location.href = import.meta.env.VITE_APP_ROUTER_PREFIX + 'index' location.href = import.meta.env.VITE_APP_ROUTER_PREFIX + 'index?redirect=' + redirectUrl
} }
}) })
}) })