mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-13 03:43:44 +08:00
Initial commit
This commit is contained in:
13
web/src/helpers/api.js
Normal file
13
web/src/helpers/api.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { showError } from './utils';
|
||||
import axios from 'axios';
|
||||
|
||||
export const API = axios.create({
|
||||
baseURL: process.env.REACT_APP_SERVER ? process.env.REACT_APP_SERVER : '',
|
||||
});
|
||||
|
||||
API.interceptors.response.use(
|
||||
(response) => response,
|
||||
(error) => {
|
||||
showError(error);
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user