post请求:
axios.post("",{}).then((res)=>{
})
get请求:
axios.get("",{}).then((res)=>{
})
跨域:
axios.get('http://dev.xxxxxxxxxxxxxxx',{
withCredentials:true
}).then((res)=>[
})
执行多个请求:
function getUserAccount() {
return axios.get('/user/12345');
}
function getUserPermissions() {
return axios.get('/user/12345/permissions');
}
axios.all([
getUserAccount
(),
getUserPermissions
()])
.then(axios.spread(
function (acct, perms) {
//两个请求现已完成
}));