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

您的位置:首頁技術(shù)文章
文章詳情頁

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

瀏覽:145日期: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 的時候去處理這個錯誤,但是拿不到這個狀態(tài)碼。但是官網(wǎng)上就是這么用的。

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
相關(guān)文章:
主站蜘蛛池模板: 久久a毛片 | 新黄色网址 | 欧美性天天 | 日韩中文字幕在线视频 | 伊人久久影视 | 狠狠五月天 | 深夜福利国产 | 国产高潮流白浆 | 久久久久久高清 | 三级视频在线看 | 色婷婷在线影院 | 午夜色网站 | 日日操日日 | 日韩国产欧美一区 | 久久精品片| 亚洲精品高清视频 | 欧美亚洲综合网 | 五月六月婷婷 | 亚洲女优在线 | 亚洲欧美国产精品久久久久久久 | 成人午夜视频在线观看 | av网站有哪些 | 天天躁夜夜躁狠狠躁 | 久久艹影院 | 天天色婷婷 | 亚洲午夜在线播放 | 久久久高清 | 国产极品少妇 | 欧美日韩一二 | 欧美多人猛交狂配 | 久久综合欧美 | 黄色片视频免费 | 四虎影视在线免费观看 | 欧美亚洲国产精品 | 在线观看自拍 | 日本一区免费 | 一级午夜| 99热这里都是精品 | 国产99精品 | 欧美性猛交ⅹ乱大交3 | 日本成人免费在线视频 |