16 lines
317 B
JavaScript
Raw Normal View History

2023-04-22 20:39:27 +08:00
import { showError } from './utils';
import axios from 'axios';
export const API = axios.create({
2024-03-23 21:24:39 +08:00
baseURL: import.meta.env.VITE_REACT_APP_SERVER_URL
? import.meta.env.VITE_REACT_APP_SERVER_URL
: '',
2023-04-22 20:39:27 +08:00
});
API.interceptors.response.use(
(response) => response,
(error) => {
showError(error);
2024-03-23 21:24:39 +08:00
},
2023-04-22 20:39:27 +08:00
);