ver 2
This commit is contained in:
@@ -4,8 +4,8 @@ import { useRouter } from 'vue-router';
|
||||
|
||||
// Создаем экземпляр axios
|
||||
const api = axios.create({
|
||||
baseURL: 'https://luminic.space/api/v1',
|
||||
// baseURL: 'http://localhost:8000/api/v1',
|
||||
baseURL: 'https://luminic.space/api/',
|
||||
// baseURL: 'http://localhost:8082/api',
|
||||
});
|
||||
|
||||
// Устанавливаем токен из localStorage при каждом запуске
|
||||
@@ -19,7 +19,7 @@ api.interceptors.response.use(
|
||||
|
||||
(response) => response,
|
||||
(error) => {
|
||||
if (error.response && error.response.status === 401) {
|
||||
if (error.response && error.response.status === 403) {
|
||||
localStorage.removeItem('token');
|
||||
const router = useRouter();
|
||||
router.push('/login');
|
||||
|
||||
Reference in New Issue
Block a user