feat: "同僚"改为"同伴" + KYC从三要素改为二要素

mobile-app:
- profile_page.dart: 将所有"同僚"改为"同伴"

identity-service:
- 层级1实名认证从三要素(姓名+身份证+手机号)改为二要素(姓名+身份证号)
- 使用阿里云 Id2MetaStandardVerify API
- 二要素验证直接调用真实API,不使用mock
- 保留三要素验证方法(verifyIdCardThreeFactor)备用

🤖 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 2026-01-02 04:20:42 -08:00
parent 47e4ef2b33
commit 8173e1f973
3 changed files with 22 additions and 20 deletions

View File

@ -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,

View File

@ -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<IdCardVerificationResult> {
// 暂时使用三要素验证(二要素需要单独开通权限
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<IdCardVerificationResult> {
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 {

View File

@ -3163,7 +3163,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
);
}
/// 192"我的同"
/// 192"我的同"
Timer? _teamPlantingUnlockTimer;
void _onTeamPlantingTap() {
@ -3300,7 +3300,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
child: Column(
children: [
const Text(
'种植树',
'种植树',
style: TextStyle(
fontSize: 12,
fontFamily: 'Inter',
@ -3371,7 +3371,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
),
),
Text(
'本人/同: ${referral['personal']} / ${referral['team']}',
'本人/同: ${referral['personal']} / ${referral['team']}',
style: const TextStyle(
fontSize: 14,
fontFamily: 'Inter',
@ -3387,7 +3387,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
);
}
///
///
Widget _buildMyTeamTree() {
//
//
@ -3410,7 +3410,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
const Padding(
padding: EdgeInsets.only(top: 8),
child: Text(
'我的同',
'我的同',
style: TextStyle(
fontSize: 16,
fontFamily: 'Inter',
@ -3437,7 +3437,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
child: Padding(
padding: EdgeInsets.all(20),
child: Text(
'暂无同',
'暂无同',
style: TextStyle(
fontSize: 14,
fontFamily: 'Inter',