项目迁移
Some checks failed
CI/CD / Code Check (push) Has been cancelled
CI/CD / Build Windows (push) Has been cancelled

This commit is contained in:
2026-03-14 21:11:59 +08:00
commit 4654f36202
153 changed files with 55923 additions and 0 deletions

30
front/src/utils/axios.ts Normal file
View File

@@ -0,0 +1,30 @@
import axios, { AxiosInstance, AxiosResponse } from 'axios';
const axiosInstance: AxiosInstance = axios.create({
baseURL: 'http://localhost:37019',
timeout: 10000,
headers: {
'Content-Type': 'application/json'
}
});
axiosInstance.interceptors.request.use(
(config) => {
return config;
},
(error) => {
return Promise.reject(error);
}
);
axiosInstance.interceptors.response.use(
(response: AxiosResponse) => {
return response;
},
(error) => {
console.error('Axios error:', error);
return Promise.reject(error);
}
);
export default axiosInstance;