/*
 * @Description: 
 * @Autor: tanglitong
 * @Date: 2020-05-30 15:04:50
 * @LastEditors: tanglitong
 * @LastEditTime: 2020-06-01 23:14:30
 */ 
import axios from 'axios';

// axios.defaults.baseURL = process.env.VUE_APP_BASE_PATH;

const service = axios.create({
  timeout: 40000,
  headers: {
    'X-Requested-With': 'XMLHttpRequest',
    'Content-Type': 'application/json; charset=UTF-8'
  },
})
service.interceptors.request.use(
  config => {
    return config
  },
  error => {
    Promise.reject(error)
  }
)

// response interceptor
service.interceptors.response.use(
  response => {
    const res = response.data;
    return res
  },
  error => {
  }
)
export default service
