diff --git a/backend/services/identity-service/src/application/services/kyc-application.service.ts b/backend/services/identity-service/src/application/services/kyc-application.service.ts index e4312205..ff66e209 100644 --- a/backend/services/identity-service/src/application/services/kyc-application.service.ts +++ b/backend/services/identity-service/src/application/services/kyc-application.service.ts @@ -214,16 +214,17 @@ export class KycApplicationService { /** * ======================================== - * 层级1: 实名认证 - 提交三要素验证 + * 层级1: 实名认证 - 提交二要素验证 * ======================================== - * 验证姓名+身份证号+手机号(手机号从用户账户获取) + * 验证姓名+身份证号 + * 注:保留手机号参数以兼容调用方,三要素验证功能保留备用 */ async submitRealNameVerification( userId: string, realName: string, idCardNumber: string, ) { - this.logger.log(`[KYC] [Level1] Submitting real name verification (3-factor) for user: ${userId}`); + this.logger.log(`[KYC] [Level1] Submitting real name verification (2-factor) for user: ${userId}`); const config = await this.getKycConfig(); if (!config.level1Enabled) { @@ -259,20 +260,19 @@ export class KycApplicationService { const attempt = await this.prisma.kycVerificationAttempt.create({ data: { userId: BigInt(userId), - verificationType: 'ID_CARD_THREE', + verificationType: 'ID_CARD_TWO', // 二要素验证(姓名+身份证号) provider: 'ALIYUN', requestId, inputData: { realName: this.maskName(realName), idCardNumber: this.maskIdCard(idCardNumber), - phoneNumber: this.maskPhoneNumber(user.phoneNumber), }, status: 'PENDING', }, }); try { - // 调用阿里云三要素验证 + // 调用阿里云二要素验证(姓名+身份证号) const result = await this.aliyunKycProvider.verifyIdCard( realName, idCardNumber, 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 3f834af5..ceb7f274 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 @@ -53,7 +53,8 @@ export interface IdCardOcrResult { /** * 阿里云实人认证服务 - 支持三层认证 * - * 层级1: 实名认证 - 三要素验证(姓名+身份证号+手机号) + * 层级1: 实名认证 - 二要素验证(姓名+身份证号) + * 备用:三要素验证(姓名+身份证号+手机号)- verifyIdCardThreeFactor * 层级2: 实人认证 - 人脸活体检测 * 层级3: KYC - 证件照OCR识别验证 * @@ -86,22 +87,23 @@ export class AliyunKycProvider { * 层级1: 实名认证 - 二要素验证(默认) * ======================================== * 验证姓名和身份证号是否匹配 - * 使用阿里云 IdCardTwoMetaVerify API (身份证二要素核验) - * 文档: https://help.aliyun.com/zh/id-verification/information-verification/developer-reference/api-cloudauth-2019-03-07-idcardtwometaverify + * 使用阿里云 Id2MetaStandardVerify API (身份证二要素标准版核验) + * 文档: https://help.aliyun.com/zh/id-verification/api-cloudauth-2019-03-07-id2metastandardverify-infor-verify */ async verifyIdCard( realName: string, idCardNumber: string, - phoneNumber: string, + phoneNumber: string, // 保留参数以兼容调用方,但二要素验证不使用 requestId: string, ): Promise { - // 暂时使用三要素验证(二要素需要单独开通权限) - return this.verifyIdCardThreeFactor(realName, idCardNumber, phoneNumber, requestId); + // 使用二要素验证(姓名 + 身份证号) + return this.verifyIdCardTwoFactor(realName, idCardNumber, requestId); } /** * 二要素验证:姓名 + 身份证号 - * 使用阿里云 IdCardTwoMetaVerify API + * 使用阿里云 Id2MetaStandardVerify API + * 文档: https://help.aliyun.com/zh/id-verification/api-cloudauth-2019-03-07-id2metastandardverify-infor-verify */ async verifyIdCardTwoFactor( realName: string, @@ -110,7 +112,7 @@ export class AliyunKycProvider { ): Promise { this.logger.log(`[AliyunKYC] [Level1] Starting 2-factor verification, requestId: ${requestId}`); - // 二要素验证始终使用真实 API,不使用 mock + // 二要素验证直接调用真实API,不使用mock if (!this.accessKeyId || !this.accessKeySecret) { this.logger.error('[AliyunKYC] KYC credentials not configured'); return { diff --git a/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart b/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart index 7ed8770f..119bf62c 100644 --- a/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart +++ b/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart @@ -3163,7 +3163,7 @@ class _ProfilePageState extends ConsumerState { ); } - /// 处理团队种植数区域的秘密点击(连续点击19次后等待2秒显示"我的同僚") + /// 处理团队种植数区域的秘密点击(连续点击19次后等待2秒显示"我的同伴") Timer? _teamPlantingUnlockTimer; void _onTeamPlantingTap() { @@ -3300,7 +3300,7 @@ class _ProfilePageState extends ConsumerState { child: Column( children: [ const Text( - '同僚种植树', + '同伴种植树', style: TextStyle( fontSize: 12, fontFamily: 'Inter', @@ -3371,7 +3371,7 @@ class _ProfilePageState extends ConsumerState { ), ), Text( - '本人/同僚: ${referral['personal']} / ${referral['team']}', + '本人/同伴: ${referral['personal']} / ${referral['team']}', style: const TextStyle( fontSize: 14, fontFamily: 'Inter', @@ -3387,7 +3387,7 @@ class _ProfilePageState extends ConsumerState { ); } - /// 构建我的同僚树 + /// 构建我的同伴树 Widget _buildMyTeamTree() { // 创建或更新根节点(缓存以保持展开状态) // 只有在数据变化时才创建新的根节点 @@ -3410,7 +3410,7 @@ class _ProfilePageState extends ConsumerState { const Padding( padding: EdgeInsets.only(top: 8), child: Text( - '我的同僚', + '我的同伴', style: TextStyle( fontSize: 16, fontFamily: 'Inter', @@ -3437,7 +3437,7 @@ class _ProfilePageState extends ConsumerState { child: Padding( padding: EdgeInsets.all(20), child: Text( - '暂无同僚', + '暂无同伴', style: TextStyle( fontSize: 14, fontFamily: 'Inter',