From 0e295a39a91d038072fbaa4bde1c8a5dd7b6fa7d Mon Sep 17 00:00:00 2001 From: Alex Cheung Date: Tue, 21 May 2024 12:52:46 +0800 Subject: [PATCH] update --- src/auth/index.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/auth/index.js b/src/auth/index.js index e104ac4..83717ba 100644 --- a/src/auth/index.js +++ b/src/auth/index.js @@ -183,12 +183,20 @@ export const SetupAxiosInterceptors = () => { // alert("登入驗證已過期,請重新登入。") // } // } + + if (error.response.status === 500) { + // await dispatch(handleLogoutFunction()); + // await navigate('/login'); + // await window.location.reload(); + } if (localStorage.getItem("expiredAlertShown")) { await dispatch(handleLogoutFunction()); await navigate('/login'); await window.location.reload(); } + + // console.log(error) } else { @@ -197,11 +205,7 @@ export const SetupAxiosInterceptors = () => { await navigate('/login'); // await window.location.reload(); } - if (error.response.status === 500) { - // await dispatch(handleLogoutFunction()); - // await navigate('/login'); - // await window.location.reload(); - } + } }