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 b4150024..ef4ae404 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 @@ -122,12 +122,19 @@ export class AliyunKycProvider { const response = await this.callAliyunApi(params); + // 打印完整的阿里云返回信息(脱敏后) + this.logger.log(`[AliyunKYC] [Level1] Aliyun API Response: ${JSON.stringify(response, null, 2)}`); + // Mobile3MetaSimpleVerify 返回结果: // - Code: OK 表示请求成功 // - ResultObject.BizCode: 0 表示验证通过, 其他值表示验证失败 if (response.Code === 'OK' || response.Code === '200') { const bizCode = response.ResultObject?.BizCode; - const isMatch = response.ResultObject?.IsConsistent === '1' || bizCode === '0'; + const isConsistent = response.ResultObject?.IsConsistent; + const subCode = response.ResultObject?.SubCode; + const isMatch = isConsistent === '1' || bizCode === '0'; + + this.logger.log(`[AliyunKYC] [Level1] ResultObject: BizCode=${bizCode}, IsConsistent=${isConsistent}, SubCode=${subCode}`); if (isMatch) { this.logger.log(`[AliyunKYC] [Level1] Verification SUCCESS for requestId: ${requestId}`); @@ -137,7 +144,7 @@ export class AliyunKycProvider { }; } else { const errorMsg = this.mapMobile3MetaErrorCode(bizCode); - this.logger.warn(`[AliyunKYC] [Level1] Verification FAILED: ${errorMsg} (BizCode: ${bizCode})`); + this.logger.warn(`[AliyunKYC] [Level1] Verification FAILED: ${errorMsg} (BizCode: ${bizCode}, SubCode: ${subCode})`); return { success: false, errorMessage: errorMsg, @@ -145,7 +152,7 @@ export class AliyunKycProvider { }; } } else { - this.logger.warn(`[AliyunKYC] [Level1] API call FAILED: ${response.Message}`); + this.logger.warn(`[AliyunKYC] [Level1] API call FAILED - Code: ${response.Code}, Message: ${response.Message}, RequestId: ${response.RequestId}`); return { success: false, errorMessage: this.mapErrorMessage(response.Code, response.Message),