api.js 368 Bytes
Newer Older
zhanghaozhe committed
1 2 3
import axios from "axios";
import qs from 'qs'

zhanghaozhe committed
4
export const BASE_URL = process.env.NODE_ENV === 'development' ? '/api' : 'https://api.julyedu.com'
zhanghaozhe committed
5 6 7 8

const instance = axios.create({
    baseURL: BASE_URL,
    transformRequest: [
zhanghaozhe committed
9
        (data) => qs.stringify(data)
zhanghaozhe committed
10 11 12 13 14
    ],
    headers: {
        HTTP_PLAT_FORM: 5,
        HTTP_PLAT: 5
    }
zhanghaozhe committed
15 16 17
})

export default instance