mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-27 21:01:32 +08:00
fix(ErrorBlock): 修复错误状态码检查逻辑以支持statusCode字段
This commit is contained in:
parent
dd1d5740d8
commit
20311af8a8
@ -36,7 +36,10 @@ const ErrorMessage: React.FC<{ block: ErrorMessageBlock }> = ({ block }) => {
|
||||
|
||||
const i18nKey = block.error && 'i18nKey' in block.error ? `error.${block.error?.i18nKey}` : ''
|
||||
const errorKey = `error.${block.error?.message}`
|
||||
const errorStatus = block.error && 'status' in block.error ? block.error?.status : undefined
|
||||
const errorStatus =
|
||||
block.error && ('status' in block.error || 'statusCode' in block.error)
|
||||
? block.error?.status || block.error?.statusCode
|
||||
: undefined
|
||||
|
||||
if (i18n.exists(i18nKey)) {
|
||||
const providerId = block.error && 'providerId' in block.error ? block.error?.providerId : undefined
|
||||
|
||||
Loading…
Reference in New Issue
Block a user