09 2018 档案

摘要:一,安装 npm install axios 二,在http.js中引入 import axios from 'axios'; 三,定义http request 拦截器,添加数据请求公用信息 1 axios.interceptors.request.use( 2 config => { 3 // c 阅读全文
posted @ 2018-09-20 15:07 zhangbs 阅读(6387) 评论(0) 推荐(0)
摘要:什么是跨域? 浏览器的安全策略,只要协议,域名,端口有任何一个不同,就被当做不同的域。 下面对http://www.qichedaquan.com的同源检测 http://www.qichedaquan.com/a.html // 同源 http://www.qichedaquan.com/b.ht 阅读全文
posted @ 2018-09-19 17:29 zhangbs 阅读(291) 评论(0) 推荐(0)
摘要:首先贴代码 注释: 1,open(method, url, async) method: GET和POST; url: 发送到服务端的url; async: 异步true,同步false; 2,onreadystatechange 每当readyState的值变化,onreadystatechang 阅读全文
posted @ 2018-09-19 15:28 zhangbs 阅读(4256) 评论(0) 推荐(0)