axios使用

axios({
method:"POST",
// url:configure.state.gateway,
url:'/api',
// headers: {
// "Content-Type": "multipart/form-data",
// 'Content-Type': 'application/json;charset=utf-8',
// 'Access-Control-Allow-Origin': '*',
// },
withCredentials:true,
data:{
action:configure.state.site_digitalcert + 'certstatic/getZszmStatisticsByMuchTime',
method: "post",
site: configure.state.eureka_digitalcert,
timeout: 6000000,
params: JSON.stringify({start: "2019-1-1,2020-1-1", end: "2019-12-31,2020-12-31", czrlx: ""}),
},
}).then((res)=>{
console.log(res);
});

官方文档https://www.kancloud.cn/yunye/axios/234845
原文地址:https://www.cnblogs.com/shihx/p/13254942.html