|
|
@@ -92,11 +92,12 @@ export const handleLogoutFunction = () => { |
|
|
|
localStorage.removeItem('webtoken') |
|
|
|
localStorage.removeItem('transactionid') |
|
|
|
//localStorage.removeItem(config.storageUserRoleKeyName) |
|
|
|
localStorage.removeItem('expiredAlertShown') |
|
|
|
localStorage.removeItem(refreshIntervalName) |
|
|
|
localStorage.removeItem(windowCount) |
|
|
|
localStorage.removeItem(predictProductionQty) |
|
|
|
localStorage.removeItem(predictUsageCount) |
|
|
|
setTimeout(()=> localStorage.removeItem("expiredAlertShown"), 5000) |
|
|
|
// setTimeout(()=> localStorage.removeItem("expiredAlertShown"), 5000) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -161,9 +162,10 @@ export const SetupAxiosInterceptors = () => { |
|
|
|
}); |
|
|
|
} else { |
|
|
|
if (error.response.status === 401) { |
|
|
|
await dispatch(handleLogoutFunction()); |
|
|
|
await navigate('/login'); |
|
|
|
await window.location.reload(); |
|
|
|
if (localStorage.getItem("expiredAlertShown") === null) { |
|
|
|
localStorage.setItem("expiredAlertShown", true) |
|
|
|
alert("登入驗證已過期,請重新登入。") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// ** if (status === 401) { |
|
|
@@ -181,11 +183,11 @@ export const SetupAxiosInterceptors = () => { |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
// if (localStorage.getItem("expiredAlertShown")) { |
|
|
|
// await dispatch(handleLogoutFunction()); |
|
|
|
// await navigate('/login'); |
|
|
|
// await window.location.reload(); |
|
|
|
// } |
|
|
|
if (localStorage.getItem("expiredAlertShown")) { |
|
|
|
await dispatch(handleLogoutFunction()); |
|
|
|
await navigate('/login'); |
|
|
|
await window.location.reload(); |
|
|
|
} |
|
|
|
|
|
|
|
if (error.response.status === 500){ |
|
|
|
//setIsUploading(false); |
|
|
|