mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
тестd3212332
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import axios from 'axios'
|
import axios, { InternalAxiosRequestConfig } from 'axios'
|
||||||
|
|
||||||
const axiosInstance = axios.create({
|
const axiosInstance = axios.create({
|
||||||
baseURL: '/api',
|
baseURL: '/api',
|
||||||
@@ -10,7 +10,7 @@ const axiosInstance = axios.create({
|
|||||||
|
|
||||||
// Добавляем перехватчик для добавления токена
|
// Добавляем перехватчик для добавления токена
|
||||||
axiosInstance.interceptors.request.use(
|
axiosInstance.interceptors.request.use(
|
||||||
(config) => {
|
(config: InternalAxiosRequestConfig) => {
|
||||||
const token = localStorage.getItem('token')
|
const token = localStorage.getItem('token')
|
||||||
if (token) {
|
if (token) {
|
||||||
config.headers.Authorization = `Bearer ${token}`
|
config.headers.Authorization = `Bearer ${token}`
|
||||||
|
|||||||
Reference in New Issue
Block a user