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

This commit is contained in:
XieYongHong 2023-04-28 15:10:40 +08:00 committed by GitHub
parent 056c694a92
commit 66bfd6bae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -167,7 +167,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)
}