午夜剧场伦理_日本一道高清_国产又黄又硬_91黄色网战_女同久久另类69精品国产_妹妹的朋友在线

您的位置:首頁技術文章
文章詳情頁

javascript - axios錯誤處理的對象error.response 是空

瀏覽:156日期:2022-11-10 16:38:31

問題描述

_this.$http.post(`/company/${id}/out`, { access_token: _this.access_token,}).then((res) => { let info = res;}).catch((err) => { console.log(err.response); // err.response 是 undefined})},

javascript - axios錯誤處理的對象error.response 是空

我想在 403 或者 401 的時候去處理這個錯誤,但是拿不到這個狀態碼。但是官網上就是這么用的。

axios.get(’/user/12345’) .catch(function (error) { if (error.response) { // The request was made and the server responded with a status code // that falls out of the range of 2xx console.log(error.response.data); console.log(error.response.status); console.log(error.response.headers); } else if (error.request) { // The request was made but no response was received // `error.request` is an instance of XMLHttpRequest in the browser and an instance of // http.ClientRequest in node.js console.log(error.request); } else { // Something happened in setting up the request that triggered an Error console.log(’Error’, error.message); } console.log(error.config); });

我的axios 的版本是 ^0.16.1。

問題解答

回答1:

403不清楚,但是我記得之前我查的答案是401會被瀏覽器攔截處理掉,js拿不到

標簽: JavaScript
相關文章:
主站蜘蛛池模板: 亚色综合 | 色婷婷综合网 | 中文字幕在线字幕中文 | 欧美人人爽 | 黄在线观看 | 午夜视频| 国产一区二区av | 国产乱码77777777 | 一品毛片 | h在线观看h | 成人网免费视频 | 成人交配视频 | 亚州久久久 | 国产精品久久久久久亚洲影视 | 91麻豆精品成人一区二区 | 99香蕉视频| 蜜桃av一区二区三区 | 国产黄色网页 | 午夜生活片 | 四虎成人精品在永久免费 | 精品视频91 | 伊人青青青 | 久久久久久久久国产精品 | 九九热精品 | 男人天堂手机在线 | 欧美午夜免费 | 男人午夜av| 日本一区二区三区在线观看视频 | 蝌蚪视频在线观看 | 天天综合网久久综合网 | 国产一区二区毛片 | 国产一区精品在线观看 | 五月综合激情日本mⅴ | 日韩射吧 | 久草这里只有精品 | 99香蕉视频| 久久久久久久久久免费视频 | 成人福利视频网站 | 自拍视频一区 | 欧美三级不卡 | 日韩一区二区三区免费观看 |