![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
AJAX
.Pisces.
这个作者很懒,什么都没留下…
展开
-
axios get请求 post请求 多个并发请求 传值 后端接值
get params:{id:1,name:'李四’}//get 传值axios.get("/get", { params: { id: 20, name: '阿狸' } }).then(d => { alert(d.data) }).catch(e => console.log(e))post ...原创 2021-10-21 15:50:49 · 1485 阅读 · 0 评论 -
axios 创建实例 添加请求拦截器
创建实例可以统一设置服务器 let aa = axios.create({ baseURL: 'http://localhost', timeout: 1000, headers: {'X-Custom-Header': 'foobar'} });请求拦截器//添加请求拦截器 aa.interceptors.request.use(function (config) { //在发送请求之前做些什么 .原创 2021-10-22 10:12:59 · 555 阅读 · 0 评论