FIX request 错误处理
This commit is contained in:
parent
63034d51af
commit
b31ae9d8ea
|
@ -4,11 +4,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default (error, vm)=>{
|
export default (error, vm)=>{
|
||||||
|
console.log(error)
|
||||||
//过滤HTTP请求错误
|
//过滤HTTP请求错误
|
||||||
if(error.status){
|
if(error.status || error.status==0){
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
var errorMap = {
|
var errorMap = {
|
||||||
InternalError: "Javascript引擎内部错误",
|
InternalError: "Javascript引擎内部错误",
|
||||||
ReferenceError: "未找到对象",
|
ReferenceError: "未找到对象",
|
||||||
|
|
|
@ -56,7 +56,7 @@ axios.interceptors.response.use(
|
||||||
} else {
|
} else {
|
||||||
ElNotification.error({
|
ElNotification.error({
|
||||||
title: '请求错误',
|
title: '请求错误',
|
||||||
message: error.response.data.message || `Status:${error.response.status},未知错误!`
|
message: error.message || `Status:${error.response.status},未知错误!`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue