nodejs 服務端發送429狀態:vue
extendInfo (req, res) { res.status(429).json('Too many requests, please try again later.') },
vue客服端node
export const ajaxPost=(url, params) => { return axios.post(ajaxIp+url, params, { headers: { // "Content-Type": "multipart/form-data" "Content-Type": "application/json" } }).then(res=>{ if (data.code == 200) { return data.data; }else { return {code:data.code,msg:data.msg} } }) .catch(err => { //捕獲異常狀態碼 console.error(err.response.status); }); }