問題:http status 500,使用axios請求時,拿不到驗證碼錯誤信息,排查下來,是沒有理解好axios的error對象信息
1.在http status爲500狀態下,會走.catch(error)
2.打印
.catch(function (error) {
console.log(error.data);//undefined,之前以爲這樣可以拿到錯誤信息
console.log(error.response,'-------');//可以拿到後端返回的信息
});