import axios from "axios";

if(process.env.NODE_ENV === 'development') {
    axios.defaults.baseURL = 'http://localhost:9980';
}else {
    axios.defaults.baseURL = 'http://172.18.222.253:12315';
}
//axios.defaults.headers.post['Content-Type'] = 'application/json';
//axios.defaults.responseType = 'application/json'
axios.defaults.timeout = 10000

axios.interceptors.request.use(function (config) {
    // 在发送请求之前做些什么
    config.headers.set('Content-Type', 'application/json');
    return config;
}, function (error) {
    // 对请求错误做些什么
    return Promise.reject(error);
});
export default axios;
