fix: 优化接口超时文案提示

This commit is contained in:
xieyonghong 2023-04-28 15:08:01 +08:00
parent b59ad04c37
commit 7ae187ba63
1 changed files with 5 additions and 1 deletions

View File

@ -166,7 +166,11 @@ const errorHandler = (error: any) => {
showNotification(error?.code, error?.response?.data?.message, '404')
}
} else if (error.response === undefined) {
showNotification(error.message, (error.stack + '').substr(0, 90), undefined)
if (error.message.includes('timeout')) {
showNotification(error.message, '接口响应超时', undefined)
} else {
showNotification(error.message, (error.stack + '').substr(0, 90), undefined)
}
}
return Promise.reject(error)
}