function getUrlRequestParam(name) { var paramUrl = window.location.search.substr(1); var paramStrs = paramUrl.split('&'); var params = {}; for (var index = 0; index < paramStrs.length; index++) { params[paramStrs[index].split('=')[0]] = decodeURI(p…
这两天在工作中遇到一个问题,一个请求返回400错误,我需要向用户展示后端返回的错误信息,但是用普通的catch方法只能获取到浏览器返回的400错误提示,不能获取到后端返回的,后经查阅得出下面方法: axios.get('/user/12345') .catch(function (error) { if (error.response) { // The request was made and the server responded with a status code // that fa…