是否可以setTimeOut
响应接下来的axios
呼叫?
export function getMetricsByContent(metricsParams) {
console.log('metricsParams: ', metricsParams);
return (dispatch) => {
return axios.post(`/rbac/aa/reads/getReport`, metricsParams).then((response) => {
console.log('metricsApiResponse: ', response);
if (response.status !== 200) {
throw Error(response.statusText);
}
return response;
}).then((response) => {
if (response) {
return response.data.msg;
} else {
return "No content available";
}
})
.catch((err) => {return err});
};
}