fix: 优化接口超时文案提示
This commit is contained in:
parent
b59ad04c37
commit
7ae187ba63
|
@ -166,8 +166,12 @@ const errorHandler = (error: any) => {
|
||||||
showNotification(error?.code, error?.response?.data?.message, '404')
|
showNotification(error?.code, error?.response?.data?.message, '404')
|
||||||
}
|
}
|
||||||
} else if (error.response === undefined) {
|
} else if (error.response === undefined) {
|
||||||
|
if (error.message.includes('timeout')) {
|
||||||
|
showNotification(error.message, '接口响应超时', undefined)
|
||||||
|
} else {
|
||||||
showNotification(error.message, (error.stack + '').substr(0, 90), undefined)
|
showNotification(error.message, (error.stack + '').substr(0, 90), undefined)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return Promise.reject(error)
|
return Promise.reject(error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue