Added znzt web app
Deploy Manager App / deploy (push) Successful in 20s
Details
Deploy Manager App / deploy (push) Successful in 20s
Details
This commit is contained in:
parent
f71fb835a9
commit
f8c3f9d5ba
|
|
@ -48,11 +48,16 @@ apiClient.interceptors.request.use(async (config) => {
|
|||
apiClient.interceptors.response.use(
|
||||
(response) => response,
|
||||
(error) => {
|
||||
if (error.response?.status === 401) {
|
||||
localStorage.removeItem('token')
|
||||
window.location.href = '/login'
|
||||
// Если сервер вернул 401 или ошибку привязки к Telegram (статус 500 с описанием)
|
||||
const errorDesc = error.response?.data?.error_description || '';
|
||||
|
||||
if (error.response?.status === 401 || errorDesc.includes('Telegram') || errorDesc.includes('аккаунт не привязан')) {
|
||||
// Принудительно очищаем токен, чтобы приложение сбросило авторизацию
|
||||
localStorage.removeItem('token');
|
||||
// Можно сразу перенаправить на корень или страницу входа
|
||||
window.location.href = '/';
|
||||
}
|
||||
return Promise.reject(error)
|
||||
return Promise.reject(error);
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue