this.axios.get('xxx').then(response => { }).catch(error => error.response)
打印error会出现下面这样的内容,不是我们想要的。
Error: Request failed with status code 403
at createError (createError.js:16)
at settle (settle.js:18)
at XMLHttpRequest.handleLoad (xhr.js:77)
打印error.response即可
转载于:https://blog.51cto.com/14009535/2376384