fix(kyc): 修正阿里云手机号三要素核验的成功判断逻辑

阿里云 Mobile3MetaSimpleVerify 返回的 BizCode:
- 1: 校验一致 (成功)
- 2: 校验不一致 (失败)
- 3: 查无记录 (失败)

之前错误地将 BizCode=0 判断为成功,现改为 BizCode=1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-25 00:28:29 -08:00
parent 4b92fb36a3
commit c3b50264cc
1 changed files with 12 additions and 9 deletions

View File

@ -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<string, string> = {
'1': '姓名与身份证号不匹配',
'2': '身份证号与手机号不匹配',
'3': '姓名与手机号不匹配',
'4': '三要素信息均不匹配',
'5': '无法查询到该手机号信息',
'6': '手机号已注销或停机',
'7': '查询失败,请稍后重试',
'2': '三要素信息校验不一致',
'3': '查无记录,请确认信息是否正确',
};
return errorMap[bizCode] || `验证失败 (错误码: ${bizCode})`;
}