diff --git a/backend/services/identity-service/src/infrastructure/external/kyc/aliyun-kyc.provider.ts b/backend/services/identity-service/src/infrastructure/external/kyc/aliyun-kyc.provider.ts index ef4ae404..269ec2d9 100644 --- a/backend/services/identity-service/src/infrastructure/external/kyc/aliyun-kyc.provider.ts +++ b/backend/services/identity-service/src/infrastructure/external/kyc/aliyun-kyc.provider.ts @@ -127,12 +127,16 @@ export class AliyunKycProvider { // Mobile3MetaSimpleVerify 返回结果: // - Code: OK 表示请求成功 - // - ResultObject.BizCode: 0 表示验证通过, 其他值表示验证失败 + // - ResultObject.BizCode: 核验结果 + // - 1: 校验一致 (成功) + // - 2: 校验不一致 (失败) + // - 3: 查无记录 (失败) if (response.Code === 'OK' || response.Code === '200') { const bizCode = response.ResultObject?.BizCode; const isConsistent = response.ResultObject?.IsConsistent; const subCode = response.ResultObject?.SubCode; - const isMatch = isConsistent === '1' || bizCode === '0'; + // BizCode === '1' 表示校验一致(成功) + const isMatch = bizCode === '1'; this.logger.log(`[AliyunKYC] [Level1] ResultObject: BizCode=${bizCode}, IsConsistent=${isConsistent}, SubCode=${subCode}`); @@ -171,16 +175,15 @@ export class AliyunKycProvider { /** * 映射手机号三要素核验错误码 + * 阿里云 Mobile3MetaSimpleVerify 返回的 BizCode: + * - 1: 校验一致 (成功) + * - 2: 校验不一致 (失败) + * - 3: 查无记录 (失败) */ private mapMobile3MetaErrorCode(bizCode: string): string { const errorMap: Record = { - '1': '姓名与身份证号不匹配', - '2': '身份证号与手机号不匹配', - '3': '姓名与手机号不匹配', - '4': '三要素信息均不匹配', - '5': '无法查询到该手机号信息', - '6': '手机号已注销或停机', - '7': '查询失败,请稍后重试', + '2': '三要素信息校验不一致', + '3': '查无记录,请确认信息是否正确', }; return errorMap[bizCode] || `验证失败 (错误码: ${bizCode})`; }