axios.get('/ceshi/8888')
.catch(function (error) {
if (error.response) {
var tips = error.response.data.error_description //状态值
console.log(error.response.data);
console.log(error.response.status);
console.log(error.response.headers);
} else if (error.request) {
console.log(error.request);
} else {
// Something happened in setting up the request that triggered an Error
console.log('Error', error.message);
}
Message({
message: tips,
type: 'error',
duration: 5 * 1000
})
return Promise.reject(error)
});
网友评论