axios 基于 Promise
.then().catch()
new Promise(function(resolve,reject){})
axios.get(url[, config]) axios.post(url[, data[, config]])
axios({
url,
method, // 请求方式
headers, // 请求头
baseURL, // 接口域名
http://localhost:3000/
data, // post 请求提交的 数据
params , // 传递查询参数search ?limit=8 timeout, // 超时
}).then(result) .catch(err)
首先要先下载插件cnpm i axios -S