import axios from 'axios'
let http = axios.create({
// `baseURL` 将自动加在 `url` 前面,除非 `url` 是一个绝对 URL。
// 它可以通过设置一个 `baseURL` 便于为 axios 实例的方法传递相对 URL
baseURL: 'http://127.0.0.1:8082',
// `withCredentials` 表示跨域请求时是否需要使用凭证
withCredentials: true,
// `headers` 是即将被发送的自定义请求头
headers: {
/*'X-Requested-With': 'XMLHttpRequest',*/
/*'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',*/
'Content-Type': 'application/json;charset-UTF-8',
/*"Access-Control-Allow-Credentials": true,*/
/*'Access-Control-Allow-Origin': '*',*/
/*'Access-Control-Allow-Methods': 'DELETE,PUT,
本文地址:https://blog.csdn.net/qq_29777207/article/details/107428326
如对本文有疑问, 点击进行留言回复!!
【JavaScript笔记(一)】万丈高楼平地起 - 基本概念篇
轻松解决 org.apache.taglibs.standard.tlv.JstlCoreTLV 困惑
vert实践五——Json?Protocol Buffer?FlatBuffers?
[基于tensorflow的人脸检测] 基于神经网络的人脸检测8——验证训练好的神经网络
网友评论