http.ts 340 Bytes
Newer Older
zhanghaozhe committed
1 2
import axios from "axios"
import qs from "qs"
zhanghaozhe committed
3

zhanghaozhe committed
4 5
axios.defaults.headers.post["Content-Type"] =
  "application/x-www-form-urlencoded"
xuzhenghua committed
6
axios.defaults.withCredentials = true
wangshuo committed
7

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