Commit Graph

864 Commits

Author SHA1 Message Date
hailin 6a2e0bf4f1 fix: 添加钱包状态检查日志用于调试
在 _checkAndStartWalletPolling() 中添加详细日志:
- 打印 isWalletReady, isAccountCreated, _serialNumber 的值
- 打印条件不满足时的原因

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 00:48:36 -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 4e52b53657 fix(admin-web): upgrade Next.js to 15.1.11 for CVE-2025-55182 security patch
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 00:31:59 -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 45fcae5ef5 revert: 撤销 admin-service seed 脚本
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 22:41:24 -08:00
hailin a1a9a087c5 fix(admin-service): 修复 Kafka topic 订阅不匹配问题
问题:admin-web 用户管理页面无数据
原因:admin-service 订阅的是 'identity.events',
     但 identity-service 发送到的是具体的 topic 如 'identity.UserAccountCreated'

修复:将订阅的 topics 改为与 identity-service 的 IDENTITY_TOPICS 一致:
- identity.UserAccountCreated
- identity.UserAccountAutoCreated
- identity.PhoneBound
- identity.KYCSubmitted
- identity.KYCVerified
- identity.KYCRejected
- identity.UserAccountFrozen
- identity.UserAccountDeactivated

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 22:40:31 -08:00
hailin 8579529571 feat(admin-service): 添加 seed 脚本同步系统账户到 user_query_view
问题:admin-web 用户管理页面无数据,因为 user_query_view 表是空的
原因:identity-service 的 seed 创建的系统账户不会触发 Kafka 事件

解决方案:
- 创建 admin-service 的 seed.ts,直接同步系统账户到 user_query_view
- 配置 package.json 的 prisma.seed

运行方式:
cd backend/services/admin-service && npx prisma db seed

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 22:35:32 -08:00
hailin be505d1070 fix: change USDT to CNY in authorization apply page
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 22:09:39 -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 93b623398e fix: add missing StorageKeys import in profile_page.dart
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:38:29 -08:00
hailin c0657f88b9 fix: 我的页面进入时直接检查钱包状态并更新UI
- 页面初始化时调用API检查钱包状态,不再只依赖60秒轮询
- 钱包就绪后刷新authProvider和触发UI重建
- 确保与监控页面状态同步

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:31:02 -08:00
hailin 0047767c47 fix: 路由配置遗漏 phoneNumber 和 smsCode 参数
SetPasswordPage 需要这两个参数才能使用新的 register-by-phone 流程

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:16:45 -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 86d3a3f6a2 perf(docker): 优化Dockerfile构建,避免最后chown整个目录
- 在build阶段提前创建用户和设置目录权限
- 使用--chown=nestjs:nodejs复制文件
- 删除chown -R nestjs:nodejs /app

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 19:31:58 -08:00
hailin b1508f1a5a fix(mpc-service): 注册DistributedLockService到InfrastructureModule
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 19:28:18 -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 5b731498de feat: 充值页面添加长按二维码10秒切换到真实钱包地址模式
- 长按二维码超过10秒可切换到显示真实KAVA钱包地址
- 切换后显示完整区块链地址和对应二维码
- 页面退出后自动恢复到充值ID模式
- 隐藏功能,不影响普通用户使用

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:46:35 -08:00
hailin 54a225ebf2 feat: 充值/提现页面添加钱包状态检查,优化钱包状态轮询逻辑
- 充值页面: 先检查钱包状态,未就绪时显示"账号审核中..."
- 提现页面: 先检查钱包状态,未就绪时显示"账号审核中..."
- 监控页面: 先从本地存储读取钱包状态,已就绪则跳过轮询
- wallet_status_provider: 先检查本地存储,避免不必要的API调用

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:36:44 -08:00
hailin 3e352dbcfe refactor: 钱包状态轮询自动重试,移除手动重试按钮
设计原则:只要钱包不是 ready 状态,就持续轮询并自动重试生成
- 移除 failed 状态和重试按钮(用户无需手动操作)
- 非 ready 时自动调用 retryWalletGeneration API(幂等)
- 轮询间隔改为60秒(API 1-10分钟幂等)
- 只有 ready 时停止轮询

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:20:10 -08:00
hailin ffd4fae0b6 fix: 只有钱包ready时才显示序列号
- mining_page: unknown状态也显示"创建账号审核中..."
- profile_page: 默认分支改为显示"创建账号审核中..."
- 符合设计:只要不成功就持续轮询重试

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 18:15:15 -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 b49c9e1af5 fix: 通过移除内边距解决验证码数字显示不全问题
- 添加 contentPadding: EdgeInsets.zero 移除默认内边距
- 添加 isDense: true 使用紧凑模式
- 移除之前错误的 showCursor 逻辑

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:59:21 -08:00
hailin 979780dd7e fix: 优化验证码输入框光标显示逻辑
- 空输入框时显示光标,让用户知道当前输入位置
- 输入数字后隐藏光标,避免光标占用空间导致数字显示不全
- 每次输入触发setState确保showCursor状态正确更新

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:57:15 -08:00
hailin c1b8a441b6 fix: 隐藏验证码输入框光标解决数字显示不全
- 添加 showCursor: false 隐藏光标
- 光标移走后数字不再被遮挡偏移

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:54:37 -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 74175336af fix: 修复验证码输入框数字显示不全
- 增加输入框尺寸 48x56 -> 50x60
- 增大字体 20sp -> 24sp
- 移除 height: 1.2 行高限制

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:37:12 -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 17121da422 fix: referral-service启动时自动执行seed
- 添加ts-node依赖用于执行seed.ts
- 在start.sh中添加prisma db seed命令
- 与identity-service保持一致

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:19:16 -08:00
hailin f98f7b2d39 fix: 修正推荐码验证API响应解析
- referral-service返回 {valid:bool} 格式
- 移除对 data 字段的依赖

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:13:18 -08:00
hailin 84d15093f0 fix: 修改推荐码验证API路径为referral-service
- 从 /referrals/validate?code=X 改为 /referral/validate/X
- 使用 referral-service 的 API (已在 Kong 配置)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 17:06:54 -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 bee48e8b87 fix: 修正推荐码验证的返回值类型处理
verifyReferralCode()返回Map<String, dynamic>,需要提取valid字段
同时从响应中获取message字段用于错误提示

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 05:52:52 -08:00
hailin 2a5cb0d2ec feat: 在向导页添加推荐码API验证
在用户点击"继续"按钮时,调用API验证推荐码是否有效:
- 推荐码不存在或已失效时显示错误提示
- 网络错误时显示友好提示
- 验证通过后才保存并跳转到注册页

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 05:47:02 -08:00
hailin a188d7629f fix: 修正推荐码验证 API 路径
将 GET /user/by-referral-code/{code} 修改为正确的
GET /referrals/validate?code={code}

修复 GENESIS 推荐码验证失败 400 错误的问题。

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 05:33:53 -08:00
hailin 80713fbb33 chore: 添加 tsbuildinfo 到 .gitignore
TypeScript 增量编译缓存文件不应提交到版本控制。

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 04:34:26 -08:00
hailin 60faa5e3cc chore: 添加 prisma 编译文件到 .gitignore
防止 seed.ts 的编译产物(.js, .js.map, .d.ts)被误提交。
seed.ts 应该保持为源码形式,由 ts-node 直接执行。

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 04:32:49 -08:00
hailin 9a5abab0bd fix: 修复 referral-service 编译配置以支持 prisma seed.ts
- 移除错误添加的 rootDir 配置(恢复原始行为)
- 在 tsconfig.build.json 中排除 prisma 目录
- 确保编译输出为 dist/main.js(符合 Dockerfile 期望)
- prisma/seed.ts 不会被 NestJS 编译流程处理

问题原因:添加 rootDir: "./src" 后,TypeScript 拒绝编译
src/ 目录之外的 prisma/seed.ts 文件。

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 04:30:35 -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 9102a2a6d7 refactor: 移除恢复账号页面的标题和副标题
- 移除「手机号+密码登录」标题
- 移除「输入您的手机号和密码」副标题
- 页面更简洁,顶部只保留「恢复账号」导航标题

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 03:47:29 -08:00
hailin 9e26b2750f fix: 修复推荐码文字颜色并统一恢复账号页面为龙虎榜风格
向导页修复:
- 推荐码输入框文字改为黑色,确保可见性

恢复账号页面重构:
- 背景改为与龙虎榜一致的渐变色(浅米色到浅橙色)
- 所有文字颜色改为棕色系,与背景协调
- 边框颜色改为金棕色(#D4A574)
- 登录按钮改为深棕色(#8B5A2B)
- 移除 AppBar,使用自定义顶部导航栏
- 保持 100% Flutter 兼容性和最佳实践

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 03:39:04 -08:00
hailin 6bbd4a6c78 fix: 修复恢复账号页面键盘弹出时的溢出错误
- 将 Column 改为 SingleChildScrollView 包裹,支持滚动
- 在底部添加额外间距,避免内容被键盘遮挡
- 修复 RenderFlex overflowed by 18 pixels 错误

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 03:35:43 -08:00
hailin 6b0194089a fix: 修复推荐码文字可见性和统一恢复账号页面设计
向导页修复:
- 推荐码输入文字改为金黄色(#FFD700),与白色底边框形成对比

恢复账号页面重构:
- 背景改为白色,与手机号注册等页面保持一致
- 添加标准 AppBar,标题居中显示"恢复账号"
- 输入框改为完全透明底部边框设计,与外部容器无感融合
- 文字颜色与底色反色:深灰色(#333333)
- 登录按钮改为金色背景(#D4A84B) + 白色文字
- 更新所有颜色以适配白色背景主题
- "立即注册"文字改为金色

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 03:29:03 -08:00
hailin 3be10493a0 refactor: 优化向导页推荐码输入框和恢复账号页面设计
向导页优化:
- 推荐码输入框改为透明底部边框设计,更好融入背景
- 增大输入框高度和字体大小,提升可读性
- 扫码图标改为白色,尺寸加大至 28sp
- 输入文字改为白色,与背景形成对比

恢复账号页面改版:
- 标题改为"恢复账号"并居中显示
- 移除副标题,界面更简洁
- 背景改为金色渐变,与 App 整体风格一致
- 登录按钮改为白色背景+深金色文字
- 优化所有输入框和文字颜色以适配金色背景
- "立即注册"文字改为白色带下划线

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 03:10:40 -08:00