fix: some
All checks were successful
构建并部署前端到测试环境 / deploy (push) Successful in 55s

This commit is contained in:
luo
2026-10-13 11:25:03 +08:00
parent 52268859aa
commit b2a76adc9a
67 changed files with 1982 additions and 200 deletions

View File

@@ -0,0 +1,24 @@
type BusinessFailure = {
code?: number | string
msg?: string
message?: string
data?: { phone?: unknown }
}
const getBusinessFailure = (value: unknown): BusinessFailure | undefined => {
if (!value || typeof value !== 'object') return undefined
const candidate = value as { response?: { data?: BusinessFailure } } & BusinessFailure
return candidate.response?.data || candidate
}
export const getExchangePhoneConflictMessage = (value: unknown): string | undefined => {
const failure = getBusinessFailure(value)
if (Number(failure?.code) !== 1202) return undefined
const phone = typeof failure?.data?.phone === 'string' ? failure.data.phone.trim() : ''
return `新资产已绑定手机号${phone ? ` ${phone}` : ''},请先到『手机号资产关联』解除后再提交`
}
export const getExchangeBusinessErrorMessage = (value: unknown): string | undefined => {
const failure = getBusinessFailure(value)
return failure?.msg || failure?.message
}