Browse Source

update

master
Alex Cheung 1 year ago
parent
commit
0e295a39a9
1 changed files with 9 additions and 5 deletions
  1. +9
    -5
      src/auth/index.js

+ 9
- 5
src/auth/index.js View File

@@ -183,12 +183,20 @@ export const SetupAxiosInterceptors = () => {
// alert("登入驗證已過期,請重新登入。") // alert("登入驗證已過期,請重新登入。")
// } // }
// } // }

if (error.response.status === 500) {
// await dispatch(handleLogoutFunction());
// await navigate('/login');
// await window.location.reload();
}
if (localStorage.getItem("expiredAlertShown")) { if (localStorage.getItem("expiredAlertShown")) {
await dispatch(handleLogoutFunction()); await dispatch(handleLogoutFunction());
await navigate('/login'); await navigate('/login');
await window.location.reload(); await window.location.reload();
} }

// console.log(error) // console.log(error)


} else { } else {
@@ -197,11 +205,7 @@ export const SetupAxiosInterceptors = () => {
await navigate('/login'); await navigate('/login');
// await window.location.reload(); // await window.location.reload();
} }
if (error.response.status === 500) {
// await dispatch(handleLogoutFunction());
// await navigate('/login');
// await window.location.reload();
}
} }


} }


Loading…
Cancel
Save