Обновлен стартовый экран
Переписаны запросы для статистики, отчетов Добавлена интеграция отчета сестры
This commit is contained in:
14
resources/js/bootstrap.js
vendored
14
resources/js/bootstrap.js
vendored
@@ -43,26 +43,12 @@ window.axios.interceptors.response.use(
|
||||
stopGlobalLoading()
|
||||
const authStore = useAuthStore()
|
||||
|
||||
console.log('Ошибка в API', error.response)
|
||||
|
||||
// Если ошибка 401 (Unauthorized)
|
||||
if (error.response?.status === 401) {
|
||||
// Если пользователь был авторизован, выполняем выход
|
||||
if (authStore.isAuthenticated) {
|
||||
authStore.logout()
|
||||
}
|
||||
}
|
||||
|
||||
// Если ошибка 403 (Forbidden)
|
||||
if (error.response?.status === 403) {
|
||||
console.error('Доступ запрещен:', error.response?.data?.message)
|
||||
}
|
||||
|
||||
// Если ошибка 422 (Validation Error)
|
||||
if (error.response?.status === 422) {
|
||||
console.log('Ошибки валидации:', error.response?.data?.errors)
|
||||
}
|
||||
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user