From 478031d36594b010b2e2cb4e716bf93b373cabba Mon Sep 17 00:00:00 2001 From: z9130 Date: Sun, 29 Sep 2024 08:59:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=9C=89=E6=97=B6=E4=B8=8D=E8=A7=81=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-contract/src/api/request/index.ts | 5 +++-- .../src/layouts/authentication/authentication.vue | 5 ++++- apps/web-office/src/api/request/index.ts | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/web-contract/src/api/request/index.ts b/apps/web-contract/src/api/request/index.ts index 218545e8..6377f518 100644 --- a/apps/web-contract/src/api/request/index.ts +++ b/apps/web-contract/src/api/request/index.ts @@ -47,7 +47,7 @@ const { onAuthRequired, onResponseRefreshToken } = return isExpired; }, /** 当token过期时触发,在此函数中触发刷新token */ - handler: async (response, method) => { + handler: async (_response, _method) => { console.warn('Access token or refresh token is invalid or expired. '); const accessStore = useAccessStore(); const authStore = useAuthStore(); @@ -58,9 +58,10 @@ const { onAuthRequired, onResponseRefreshToken } = ) { accessStore.setLoginExpired(true); } else { - await authStore.logout(); + await authStore.logout(false); } throw new Error('登录已过期,请重新登录'); + // const userStore = useUserStore(); // try { // let rToken = userStore.refreshToken; diff --git a/apps/web-contract/src/layouts/authentication/authentication.vue b/apps/web-contract/src/layouts/authentication/authentication.vue index a8b687e3..50af611a 100644 --- a/apps/web-contract/src/layouts/authentication/authentication.vue +++ b/apps/web-contract/src/layouts/authentication/authentication.vue @@ -89,7 +89,10 @@ const { authPanelCenter, authPanelLeft, authPanelRight, isDark } = --> - + diff --git a/apps/web-office/src/api/request/index.ts b/apps/web-office/src/api/request/index.ts index da3d0334..7ae63319 100644 --- a/apps/web-office/src/api/request/index.ts +++ b/apps/web-office/src/api/request/index.ts @@ -58,7 +58,7 @@ const { onAuthRequired, onResponseRefreshToken } = ) { accessStore.setLoginExpired(true); } else { - await authStore.logout(); + await authStore.logout(false); } throw new Error('登录已过期,请重新登录'); // const userStore = useUserStore();