hailin
bf64391c0c
feat(identity): 改用创意组合名字替代序号命名
...
将用户名格式从"榴莲皇后x号"改为"榴莲皇后xxx",
其中xxx是2-4字的创意组合,包含前缀、核心词和后缀。
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 00:25:03 -08:00
hailin
27a4bbfbef
feat(authorization): 实现火柴人排名用户详情查看功能
...
后端:
- identity-service: 新增内部API获取用户详情(手机号、邮箱、KYC等)
- referral-service: 新增内部API获取用户团队统计(直推人数、伞下用户数、认种数量)
- authorization-service:
- 新增用户公开资料和私密资料API
- 聚合identity-service和referral-service数据
- 省团队以上权限可查看私密信息(脱敏处理)
前端:
- 新增UserProfileDialog弹窗组件,支持查看用户详情
- stickman_race_widget: 排名列表项可点击查看用户详情
- authorization_service: 新增getUserProfile/getUserPrivateProfile方法
用户详情包括:
- 基本信息: 用户ID、昵称、头像、注册时间、所在地区
- 团队数据: 推荐人、直推人数、伞下用户数、个人/团队认种数
- 授权信息: 授权类型、权益激活状态
- 联系信息(特权用户可见): 手机号、邮箱、真实姓名(脱敏)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 22:42:19 -08:00
hailin
53ef1ade42
fix(sms): 增强短信发送重试机制
...
- 最大重试次数从 2 次增加到 4 次
- 基础延迟从 3 秒增加到 6 秒
- 最大延迟从 10 秒增加到 30 秒
这些调整提高了短信发送在网络不稳定情况下的成功率
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 22:14:32 -08:00
hailin
ab23270863
chore(identity): add migration for email field and email_codes table
...
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 21:23:36 -08:00
hailin
f8dbac449a
fix(identity): add EmailService to InfrastructureModule in app.module.ts
...
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 21:12:22 -08:00
hailin
93b0f1ff96
chore(identity): add nodemailer dependency for email service
...
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 21:05:26 -08:00
hailin
a38aac5581
feat(email): 实现邮箱绑定/解绑功能
...
后端:
- 新增 EmailService 邮件发送服务,支持 Gmail SMTP
- 新增 EmailCode 数据模型用于存储邮箱验证码
- UserAccount 添加 email 字段
- 新增 API 接口:
- GET /user/email-status 获取邮箱绑定状态
- POST /user/send-email-code 发送邮箱验证码
- POST /user/bind-email 绑定邮箱
- POST /user/unbind-email 解绑邮箱
- 新增 DTOs: SendEmailCodeDto, BindEmailDto, UnbindEmailDto
- 新增 Commands: SendEmailCodeCommand, BindEmailCommand, UnbindEmailCommand
前端:
- account_service 新增邮箱相关方法和 EmailStatus 类
- bind_email_page 更新为使用真实 API:
- 绑定/更换邮箱功能
- 独立的解绑验证码输入和倒计时
- 解绑确认对话框
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 20:53:20 -08:00
hailin
69fa43ebee
feat(auth): 实现修改密码API和Token过期自动跳转登录
...
后端:
- 新增 ChangePasswordCommand 和 ChangePasswordDto
- 新增 POST /user/change-password 接口
- 实现 changePassword() 方法,验证旧密码后更新新密码
前端:
- 新增 AuthEventService 认证事件服务,处理 token 过期事件
- api_client 在 token 刷新失败时发送过期事件
- App 监听认证事件,token 过期时清除账号状态并跳转登录页
- splash_page 优化路由逻辑:退出登录后跳转手机登录页而非向导页
- change_password_page 调用真实 API 修改密码
- account_service 新增 changePassword() 方法
- multi_account_service 退出登录时清除 phoneNumber 和 isPasswordSet
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 20:25:56 -08:00
hailin
136c831922
fix(identity-service): 添加 DTO 验证装饰器
...
- 为 BatchGetUsersBySequenceDto 添加 class-validator 装饰器
- 修复 ValidationPipe 验证失败问题
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 03:08:25 -08:00
hailin
1d21ae8ff7
fix(identity-service): 修复 InternalController 未注册问题
...
- 在 app.module.ts 的内联 ApiModule 中添加 InternalController
- 添加 InfrastructureModule 导入和 UserAccountRepositoryImpl provider
- 修正 authorization-service 的 identity-service URL 默认值
问题原因:app.module.ts 定义了内联 ApiModule,不是导入的 api.module.ts
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 03:04:57 -08:00
hailin
a194fcad72
fix(identity-service): 内部接口改用 accountSequence 查询
...
- identity-service InternalController 改用 accountSequence 批量/单个查询
- 添加 findByAccountSequences 批量查询方法
- authorization-service 调用改为 batchGetUserInfoBySequence/getUserInfoBySequence
- 系统间通信统一使用 accountSequence 作为标识符
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 02:16:12 -08:00
hailin
5fa195e4bc
fix: 修复火柴人排名显示问题
...
1. identity-service: 添加批量获取用户信息内部接口
- 新增 InternalController 提供 POST /internal/users/batch
- repository 添加 findByUserIds 批量查询方法
2. authorization-service: 修复 cumulativeCompleted=0 问题
- assessAndRankRegion 改用 findByAccountSequence 查询团队统计
- referral-service 使用 accountSequence 作为主键
3. mobile-app: 修复火柴人UI显示问题
- 容器边距调整为16px与其他组件一致
- 行高增加到100px避免火柴人重叠
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 01:48:16 -08:00
hailin
02361c4dcd
fix(identity-service): 内部接口 by-wallet-address 添加 @Public 装饰器
...
修复服务间调用查询钱包地址时返回 401 的问题
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 23:21:11 -08:00
hailin
f9222fed50
feat: 实现ID-to-ID内部转账功能
...
- 添加内部转账标识字段:is_internal_transfer, to_account_sequence, to_user_id
- 提现时自动检测目标地址是否为内部用户
- 内部转账确认后创建双向流水:发送方TRANSFER_OUT,接收方TRANSFER_IN
- 新增identity-service钱包地址查询API支持内部用户识别
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 22:22:47 -08:00
hailin
cb0f10af34
feat: 多项业务功能增强
...
- 动态提取手续费配置:支持固定/百分比两种费率类型,默认2绿积分/笔
- 找回密码功能:新增手机号+短信验证码重置密码流程
- 授权申请优化:自助申请时验证团队链授权状态
- UI文案调整:登录账号、监控页待开启等
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 19:00:02 -08:00
hailin
9b9427d6a8
fix(identity-service): 修复 seed 脚本会清除所有用户数据的严重 bug
...
问题:每次部署 identity-service 时,seed 脚本会执行 deleteMany() 删除所有用户数据
修复:
- 检查现有用户数量,如果 > 5 则跳过 seed(保护生产数据)
- 移除所有 deleteMany() 调用
- 使用 upsert 确保系统账户存在而不是先删后建
- 管理员账户只在不存在时创建
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 03:28:59 -08:00
hailin
74c78440f7
fix: 推荐码必填 + referral-service种子用户userId修复
...
1. register-by-phone.dto.ts: inviterReferralCode 改为必填
2. user-application.service.ts: 添加日志和推荐码验证
3. referral-service/seed.ts: userId改为25129999999(与accountSequence一致)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 00:37:08 -08:00
hailin
0220650cd9
fix(identity-service): 种子用户序列号改为 D25129999999
...
避免与真实用户序列号冲突
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 23:36:54 -08:00
hailin
1f15c494c1
fix(identity-service): 添加注册流程详细日志和保存验证
...
问题:用户注册后 referral-service 有数据但 identity-service 没有
原因:save() 方法和 registerByPhone 方法缺少日志,无法追踪问题
修复:
- save() 方法添加完整日志和 try-catch
- registerByPhone 方法添加每个步骤的日志
- 添加关键验证:保存后检查 userId 是否为 0
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 23:19:24 -08:00
hailin
ecf3755227
feat: integrate real API for authorization apply page
...
Changes:
- Add generic image upload API endpoint (POST /user/upload-image)
- Add uploadImage method in StorageService for backend
- Add uploadImage method in AccountService for frontend
- Add selfApplyStatus and selfApplyAuthorization methods in AuthorizationService
- Replace mock data with real API calls in authorization apply page
- Add API endpoints for self-apply status and self-apply authorization
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 22:01:28 -08:00
hailin
5904f2f84d
fix: improve logging for wallet retry task and idempotent status updates
...
- Change misleading "unexpected" log to correctly indicate idempotent behavior
- Add debug log for completed records being skipped in retry task
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:40:04 -08:00
hailin
188075b2be
fix: 短信超时返回成功状态避免前端报错
...
超时情况下短信可能已发送成功,返回 success: true + uncertain: true
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 20:55:31 -08:00
hailin
d36a58341d
fix: 优化短信重试策略避免触发流控
...
- 降低重试次数到 2 次
- 增加基础延迟到 3 秒
- 超时错误不重试(短信可能已发送成功)
- 流控错误不重试
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 20:38:47 -08:00
hailin
e5e4e3512b
feat: 添加短信发送重试机制提高可靠性
...
- 最多重试 3 次(共 4 次尝试)
- 指数退避延迟(1s, 2s, 4s)
- 超时时间增加到 15 秒
- 只对网络错误重试,业务错误不重试
- 可重试错误:ConnectTimeout, ReadTimeout, ETIMEDOUT, ECONNRESET 等
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 20:32:45 -08:00
hailin
b4dafc9e38
fix: 添加遗漏的 registerByPhone 方法到 user-application.service.ts
...
修复构建错误:Property 'registerByPhone' does not exist on type 'UserApplicationService'
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 20:22:44 -08:00
hailin
2897a0c74c
feat: 添加 register-by-phone API 实现手机号一步注册
...
- 后端: 添加 POST /user/register-by-phone 接口
- 验证短信验证码、创建账户、绑定手机号、设置密码、触发钱包生成
- 添加 RegisterByPhoneCommand 和 RegisterByPhoneDto
- 前端: 修改注册流程使用新 API
- SmsVerifyPage 直接跳转到密码页面传递验证码
- SetPasswordPage 调用 registerByPhoneWithPassword 一步完成
- AccountService 添加 registerByPhoneWithPassword 方法
修复手机号注册流程中手机号和密码未正确保存的问题
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 20:19:46 -08:00
hailin
10b25e222e
fix: 防止钱包生成中状态下重复触发MPC keygen
...
问题:
- 前端在钱包状态为"generating"时仍然调用retryWalletGeneration
- 后端identity-service没有检查生成中状态
- mpc-service没有幂等保护,可能导致同一用户多次keygen
修复:
1. 前端 wallet_status_provider.dart:
- 只在"failed"状态下才触发重试
- "generating"状态只更新UI,继续轮询等待
2. 后端 identity-service user-application.service.ts:
- retryWalletGeneration添加Redis状态检查
- pending/generating/deriving状态下跳过重试
- 只有failed或无状态时才触发重试
3. 后端 mpc-service keygen-requested.handler.ts:
- 使用分布式锁防止同一用户重复keygen
- 锁TTL为5分钟,覆盖整个keygen过程
- 无法获取锁时跳过请求
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:55:51 -08:00
hailin
c77cb7a55f
fix: 添加 -m 参数创建用户home目录
...
npm cache 需要写入 /home/nestjs 目录,useradd 需要 -m 参数才会创建
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:01:19 -08:00
hailin
36f8ee1d6a
fix: SEED01用户状态改为ACTIVE
...
- SYSTEM状态会被识别为冻结账户
- 必须是ACTIVE才能作为有效推荐人
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:52:06 -08:00
hailin
7a9bb26423
perf: 优化Dockerfile避免chown -R耗时
...
- 先创建用户再安装依赖
- 使用 COPY --chown 直接设置文件权限
- 移除 chown -R nestjs:nodejs /app 步骤
- 显著减少 Docker 构建时间
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:41:27 -08:00
hailin
a533987013
fix: SEED01用户accountSequence改为D25122100000格式
...
- identity-service: S0000000005 -> D25122100000
- referral-service: S0000000005 -> D25122100000
- 种子用户序号0,真实用户从1开始
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:35:01 -08:00
hailin
6039bffa73
fix: 修改种子用户推荐码为SEED01(6字符)
...
生产环境的ReferralCode值对象限制推荐码必须恰好6个字符,
GENESIS(7字符)不符合格式要求,改为SEED01
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 06:05:45 -08:00
hailin
c58cc351d0
feat: 添加 GENESIS 系统种子用户用于初始推荐码
...
- 在 identity-service 中添加 GENESIS 用户 (userId=5, code=GENESIS)
- 创建 referral-service seed.ts 同步 GENESIS 推荐关系
- 新用户注册时可使用 GENESIS 推荐码进行注册
- GENESIS 用户作为根节点,便于追踪无推荐人的用户
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 04:09:39 -08:00
hailin
7d6e776e5e
refactor: 清理 migration 和 seed 数据重复定义
...
Migration 职责:
- 只负责表结构(CREATE TABLE、索引、外键)
- 设置 user_id 序列从 10 开始(预留 1-9 给系统)
- 移除 GENESIS 用户插入(数据应由 seed 管理)
Seed 职责:
- 恢复到前天状态,移除重复的 GENESIS 定义
- 保留 4 个系统账户(ID 1-4)
- 保留管理员账户初始化
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 00:43:28 -08:00
hailin
37f2b556e9
refactor: 合并 identity-service migrations 为单一 init
...
将 7 个碎片化的 migration 文件合并为一个完整的 init migration:
- 删除增量 migrations (add_user_totp, add_outbox_events, add_password_hash 等)
- 创建统一的 20241204000000_init migration 包含所有表结构
- 包含所有索引、外键约束、序列设置和系统种子用户
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 00:32:58 -08:00
hailin
7a6d8adcb5
fix: 在 seed 中添加 GENESIS 系统种子用户
...
问题原因:
- seed.ts 会删除所有 userAccount 记录
- 即使 migration 创建了 GENESIS 用户,seed 运行后也会被删除
- 之前的系统账户使用 userId 1-4,但 GENESIS 应该是 userId 1
解决方案:
- 将 GENESIS 用户添加到 SYSTEM_ACCOUNTS 数组
- userId: 1, accountSequence: 'SYSTEM00001', referralCode: 'GENESIS'
- 其他系统账户的 userId 顺延到 2-5
系统账户列表:
- userId 1: GENESIS (系统种子用户,用于注册推荐码)
- userId 2: 总部社区 (HQ000001)
- userId 3: 成本费账户 (COST0002)
- userId 4: 运营费账户 (OPER0003)
- userId 5: RWAD底池账户 (POOL0004)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 23:44:15 -08:00
hailin
14d4107a10
fix: 修复推荐码验证 API 错误处理
...
后端修复:
- getUserByReferralCode() 在推荐码不存在时抛出异常
- 之前返回 null,导致前端无法正确判断错误
前端修复:
- 增强 verifyReferralCode() 的响应检查
- 检查 response.data 和 data 字段是否为 null
- 添加详细的 debug 日志输出
- null 响应视为推荐码无效并抛出异常
问题原因:
- 后端返回 null 时,前端解析 response.data.data 会得到 null
- 前端没有检查 null 情况,导致显示 "status: null" 错误
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 23:41:53 -08:00
hailin
636a06c241
feat: 手机号注册时触发钱包生成
...
修复问题:
- 之前手机号注册只创建账户,不生成钱包
- autoCreateAccount 方法会触发钱包生成,但 register 方法没有
解决方案:
- 在 register() 方法中添加 MpcKeygenRequestedEvent 发布
- 与 autoCreateAccount() 保持一致的钱包生成流程
流程:
1. 验证短信验证码和推荐码
2. 创建用户账户并保存到数据库
3. 发布 UserAccountCreatedEvent(推荐关系等)
4. 发布 MpcKeygenRequestedEvent(触发异步钱包生成)
5. 返回 JWT Token 给用户
钱包生成异步流程:
- MPC Service 监听 MpcKeygenRequestedEvent
- 生成 MPC 密钥对,发布 KeygenCompleted
- Blockchain Service 派生区块链地址
- Identity Service 保存钱包地址到数据库
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 23:11:16 -08:00
hailin
ef9056c5ef
revert: 移除 Dockerfile 中的 migration 特定修复逻辑
...
- Dockerfile 应该保持通用,不针对特定 migration
- migration 文件本身已修复(没有 created_at 列)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 22:09:50 -08:00
hailin
5fcaeb8794
fix: 恢复 GENESIS 种子用户 migration(正确版本)
...
- 之前误删了 migration 文件
- 重新创建正确的 migration(不包含 created_at 列)
- 添加启动时自动处理失败 migration 的机制
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 22:08:37 -08:00
hailin
0c94b966b0
fix(identity-service): 修复 GENESIS 种子用户 migration - 移除不存在的 created_at 列
...
- 修复 migration 失败问题:user_accounts 表只有 registered_at 和 updated_at,没有 created_at
- 保持 user_id = 1 用于系统种子用户(GENESIS 推荐码)
- 普通用户从 user_id = 10 开始
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 21:18:57 -08:00
hailin
ac8eb6d38d
fix: 修复系统种子用户 migration,移除错误的序列重置
...
问题:
- 之前的 migration (20251220000000) 已经预留了 user_id 1-9 给系统账号
- 并设置序列从 10 开始
- 不应该再次重置序列,否则会覆盖之前的设置
修复:
- 保留使用 user_id = 1(在预留范围内)
- 移除序列重置代码
- 添加注释说明与之前 migration 的关系
这样确保:
✅ 系统账号使用 1-9
✅ 普通用户从 10 开始(之前的设置)
✅ 不会产生 ID 冲突
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 21:01:34 -08:00
hailin
9fd5d1d17d
feat: 添加系统种子用户 migration (推荐码: GENESIS)
...
## 目的
解决"第一个用户无法注册"的问题,通过创建系统种子用户提供根推荐码。
## 种子用户信息
- User ID: 1 (固定ID)
- Account Sequence: SYSTEM00001
- 推荐码: GENESIS
- 昵称: 系统
- 状态: ACTIVE
- 手机号: NULL (系统用户不需要手机号)
## 使用方式
第一批用户在注册时使用推荐码 **GENESIS** 即可完成注册。
## 特点
✅ 保持推荐码必填的业务逻辑
✅ 所有用户都有完整的推荐关系链
✅ 系统用户只提供推荐码功能,不参与其他业务
✅ 使用固定 ID,方便识别和管理
✅ 自动重置序列,确保后续用户从 100000000 开始
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 20:57:34 -08:00
hailin
4c645afc44
fix: 修复钱包重试事件创建的字段错误
...
移除 createWalletGenerationEvent 方法中不存在的字段:
- deviceName(事件定义中不存在)
- deviceInfo(事件定义中不存在)
- inviterReferralCode(应该是 inviterSequence)
使用正确的事件字段结构,与正常账号创建保持一致。
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 20:45:10 -08:00
hailin
d45be594a2
fix: 修复 UserAccountCreatedEvent phoneNumber 类型错误
...
修改 phoneNumber 字段类型从 string 改为 string | null,
以支持钱包重试场景中手机号可能为空的情况。
这个修复解决了 Docker 构建时的 TypeScript 编译错误:
- Type 'string | null' is not assignable to type 'string'
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 20:43:26 -08:00
hailin
b4c4239593
feat: 实现手机号+密码登录和账号恢复功能
...
## 后端更改
### 新增功能
- 添加手机号+密码登录 API (`POST /user/login-with-password`)
- 新增 LoginWithPasswordDto 验证手机号格式和密码长度
- 实现 loginWithPassword 服务方法,使用 bcrypt 验证密码
- 返回 JWT tokens(accessToken + refreshToken)
### 代码优化
- 修复 phone.validator.ts 中的 TypeScript 类型错误(Object -> object)
## 前端更改
### 新增功能
- 实现手机号+密码登录页面 (phone_login_page.dart)
- 完整的表单验证(手机号格式、密码长度)
- 集成 AccountService.loginWithPassword API
- 登录成功后自动更新认证状态并跳转主页
### 账号服务优化
- 在 AccountService 中添加 loginWithPassword 方法
- 调用后端 login-with-password API
- 自动保存认证数据(tokens、用户信息)
- 使用 _savePhoneAuthData 统一保存逻辑
### UI 文案更新
- 向导页文案修改:"创建账号" → "注册账号"
- 更新标题、副标题和按钮文本
- 添加"恢复账号"按钮,跳转到手机号密码登录页
## 已验证功能
✅ 前端代码编译通过(0 errors, 仅有非关键警告)
✅ 后端代码编译通过(0 errors, 仅有非关键警告)
✅ 30天登录状态保持(JWT refresh token 已配置为30天)
✅ 自动路由逻辑(有登录状态直接进入主页)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 20:35:44 -08:00
hailin
ceee3167cb
feat(identity-service): 添加手动钱包重试 API
...
功能:
- 新增 POST /user/wallet/retry 接口
- 用户可主动触发钱包生成重试
- 自动检查钱包是否已完成,避免重复生成
- 幂等操作:重新发布 UserAccountCreatedEvent
实现:
- UserAccountController: 添加 wallet/retry 端点
- UserApplicationService: 实现 retryWalletGeneration 方法
- 重用现有的 createWalletGenerationEvent 方法
- 更新 Redis 状态为 pending
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 19:22:27 -08:00
hailin
959fe93092
feat(identity-service): 添加钱包生成自动重试机制
...
功能:
- 新增 WalletRetryTask 定时任务,每分钟扫描一次
- 自动检测超过 60 秒仍在 generating/deriving 状态的钱包
- 自动检测状态为 failed 的钱包生成
- 幂等重试机制,最多 10 分钟内持续重试
- 记录重试次数和时间戳
技术实现:
- 使用 @nestjs/schedule 的 Cron 装饰器
- 在 UserAccount 聚合根中添加 createWalletGenerationEvent() 方法
- 在 RedisService 中添加 keys() 方法支持模式匹配扫描
- 通过重新发布 UserAccountCreatedEvent 触发幂等重试
相关需求:
- 用户手机号验证成功后立即创建账号
- 钱包生成在后台异步进行
- 失败后自动重试,无需用户感知
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 19:20:55 -08:00
hailin
4ec92d015b
fix(identity-service): 添加 CA 证书以支持 HTTPS 连接
...
- 在 Dockerfile 中安装 ca-certificates 包
- 修复阿里云短信 API SSL 证书验证错误
- 解决 "error setting certificate file" 问题
问题: curl 提示 "error setting certificate file: /etc/ssl/certs/ca-certificates.crt"
原因: 容器内缺少 CA 证书文件
解决: 安装 ca-certificates 包
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 18:30:04 -08:00
hailin
287ab6bfa9
fix(identity-service): 增加阿里云短信 API 连接超时时间
...
- 连接超时从默认值增加到 10 秒
- 读取超时从默认值增加到 10 秒
- 改善网络不稳定环境下的短信发送成功率
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 18:29:07 -08:00