2024-10-02 12:12:08: merge [main:16971cbe416042ae43887c7e13afe00eb8bde1fa];
This commit is contained in:
1 parent
83a1cd2205
commit
10347e8e18
8 files changed
+28
-21
No files matched your search
@@ -30,12 +30,17 @@ apiService.interceptors.request.use(
|
||||
(error: AxiosError<MSPError>) => Promise.reject(error)
|
||||
)
|
||||
|
||||
const localClear = () => {
|
||||
LocalStorage.remove(localStorageKeys.USER_TOKEN)
|
||||
LocalStorage.remove(localStorageKeys.HEADER_NAME)
|
||||
}
|
||||
|
||||
apiService.interceptors.response.use(
|
||||
async (response: any) => response,
|
||||
(error: AxiosError<MSPError>) => {
|
||||
console.error(error)
|
||||
if (error.response && error.response.status === 401) {
|
||||
LocalStorage.clear()
|
||||
localClear()
|
||||
message.error('Ваша сессия истекла"').then()
|
||||
LocalStorage.set('redirectUrl', location.pathname)
|
||||
window.location.href = routePaths.login
|
||||
|
||||
Reference in new issue
Block a user