axios({
method: 'POST',
url: 'url',
headers: {
'Authorization': window.sessionStorage.getItem("key")
},
timeout: 4000, // 4 seconds timeout 超时
params: params
}).then(res => {
console.log(res);
}).catch(err => {
console.log(err);
});
axios({
method: 'POST',
url: 'url',
headers: {
'Authorization': window.sessionStorage.getItem("key")
},
timeout: 4000, // 4 seconds timeout 超时
params: params
}).then(res => {
console.log(res);
}).catch(err => {
console.log(err);
});
本文标题:axios请求设置超时
本文链接:https://www.haomeiwen.com/subject/yqoboctx.html
网友评论