hailin
26dcd1d2de
fix(pre-planting): 修复购买省市名称存储及多项购买失败问题
...
== 问题修复 ==
1. 购买失败:NestJS 返回数组 message 导致 Flutter 类型转换错误
- 症状:List<dynamic> is not a subtype of String
- 原因:ValidationPipe 校验失败时 message 字段为 List<String>(每条字段错误一条),
Flutter _handleDioError 直接用 data['message'] 作为 String 参数导致运行时崩溃
- 修复:api_client.dart 中对 rawMsg 判断是否 List,若是则 join(', ')
2. 续购省市为空导致 400 校验失败
- 症状:续购时后端返回 "provinceCode should not be empty"
- 原因:购买页面续购分支未传入省市,导致 provinceCode/cityCode 为 null
- 修复:pre_planting_purchase_page.dart 中续购时使用 _position?.provinceCode
3. 购买请求携带 provinceName/cityName 被后端 forbidNonWhitelisted 拒绝
- 症状:400 "property provinceName should not exist"
- 原因:前端发送名称字段,但 PurchasePrePlantingDto 未声明这些字段
- 修复:在 DTO 中添加 @IsOptional() 的 provinceName / cityName 字段
== 功能新增 ==
4. 预种持仓表新增省市名称存储(参照正式认种的处理方式)
- 迁移:20260228000000_add_province_city_name_to_position
- Prisma schema:PrePlantingPosition 新增 provinceName / cityName 可空字段
- 聚合根:addPortions() 接受可选 provinceName/cityName,首购时写入,续购忽略
- Repository:save/toDomain 同步处理名称字段
- Application Service:purchasePortion 透传名称,getPosition 返回名称
- Controller:purchase 端点透传 dto.provinceName / dto.cityName
5. 预种合并时算力精确回滚(contribution-service)
- 新增 9a-team 步骤:事务内查询即将作废的 TEAM_LEVEL/TEAM_BONUS 算力记录
- 新增 9c-team 步骤:按账户聚合后精确 decrement 上游推荐人的各档位 pending 和 effective
- 目的:确保旧份额算力精确回滚,避免新树算力 9d 叠加后造成双倍计入
== UI 优化 ==
- 购买页面将 "USDT" 改为 "绿积分"(单价、总价、成功提示)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 08:02:14 -08:00
hailin
9b6effe63d
debug(pre-planting): 添加购买流程详细日志以排查 List cast 错误
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 07:19:35 -08:00
hailin
606d3c0b22
fix(pre-planting): 修复购买失败时 List<dynamic> 类型转换错误和续购省市缺失
...
1. api_client.dart: NestJS validation error 返回 message 为数组时,
用 join(', ') 转为字符串,避免直接传给 ApiException(String) 崩溃
2. pre_planting_purchase_page.dart: 续购时传 _position 中已保存的
provinceCode/cityCode,满足后端 DTO 必填校验
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 06:56:49 -08:00
hailin
7a4a207bed
feat(mobile-app): 增强合同PDF下载可靠性和用户体验
...
- PDF下载增加10次自动重试机制,使用指数退避策略
- 超时时间延长至300秒,适应大文件和慢网络
- 新增下载进度显示(百分比圆环)
- 失败后显示重试按钮,区分任务加载错误和PDF下载错误
- ApiClient.get方法新增cancelToken和onReceiveProgress参数支持
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 07:12:21 -08:00
hailin
e6da0cbb05
fix(mobile-app): 修复 Token 刷新并发竞态导致的意外过期问题
...
- 添加 Token 刷新锁,确保多个 401 请求只触发一次刷新
- 添加过期通知去重,避免重复弹出登录过期提示
- 增强 deviceId 校验,缺失时记录日志
- 添加详细调试日志便于排查问题
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 07:20:31 -08:00
hailin
0f745a17fd
feat(kyc): 实现完整三层KYC认证功能
...
实现三层KYC认证系统,支持后台配置开关:
- 层级1: 实名认证 (二要素: 姓名+身份证号)
- 层级2: 实人认证 (人脸活体检测)
- 层级3: KYC (证件照上传验证)
后端变更:
- 更新 Schema 添加三层认证字段和 KycConfig 表
- 添加 migration 支持增量字段和配置表
- 重写 AliyunKycProvider 支持阿里云实人认证 API
- 重写 KycApplicationService 实现三层认证逻辑
- 更新 KycController 添加用户端和管理端 API
前端变更:
- 更新 KycService 支持三层认证 API
- 重构 KycEntryPage 显示三层认证状态
- 重构 KycIdPage 用于层级1实名认证
- 新增 KycFacePage 用于层级2人脸认证
- 新增 KycIdCardPage 用于层级3证件照上传
- 添加 uploadFile 方法到 ApiClient
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 07:14:11 -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
e825d6938d
fix(mobile-app): don't clear auth data on token refresh failure
...
Avoid clearing user's auth data when token refresh fails due to
network errors or other transient issues. Only clear on explicit
refresh token expiration.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 22:49:19 -08:00
hailin
c27f8e801e
fix(mobile-app): accept 201 status code for token refresh
...
auto-login API returns 201 (Created) not 200, causing token refresh
to fail even though the response was successful
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 22:46:49 -08:00
hailin
c771a81e05
fix(mobile-app): fix 401 token refresh not working
...
1. Add /user/auto-login to publicPaths so it doesn't inject old token
2. Skip 401 handling for auto-login itself to avoid recursion
3. Add debug logs for token refresh flow
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 22:43:30 -08:00
hailin
0cf9f023f9
fix(mobile-app): fix token refresh parsing from auto-login response
...
API returns { success, data: { accessToken, refreshToken } } but code
was reading accessToken directly from response.data instead of
response.data.data
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 22:34:24 -08:00
hailin
747e4ae8ef
refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing
...
- Remove Address field from PartyEndpoint (parties connect to router themselves)
- Update K8s Discovery to only manage PartyID and Role labels
- Add Party registration and SessionEvent protobuf definitions
- Implement PartyRegistry and SessionEventBroadcaster domain logic
- Add RegisterParty and SubscribeSessionEvents gRPC handlers
- Prepare infrastructure for party-driven MPC coordination
This is the first phase of migrating from coordinator-driven to party-driven
architecture following international MPC system design patterns.
2025-12-05 08:11:28 -08:00
Developer
ad739a83f8
fix(mobile-app): 修复 API 请求路径缺少 /api/v1 前缀问题
...
问题原因:
- 原 ApiClient baseUrl 为 'https://rwaapi.szaiai.com '
- 请求路径为 '/user/auto-create'
- 实际请求: https://rwaapi.szaiai.com/user/auto-create (错误)
- 正确路径: https://rwaapi.szaiai.com/api/v1/user/auto-create
解决方案:
- 新增 AppConfig 配置管理类
- 支持多环境配置 (dev/staging/prod)
- apiBaseUrl 已包含 /api/v1 前缀
- 支持 --dart-define=ENV=dev 切换环境
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 08:41:37 -08:00
Developer
2d50ad32a9
docs: 添加系统部署指南和更新 API 配置
...
添加 DEPLOYMENT_GUIDE.md:
- 完整的 Nginx 反向代理配置 (rwaapi.szaiai.com)
- Docker Compose 生产环境部署配置
- 后端服务端口规划和 API 路由映射
- 前端 API 调用对照表
- SSL/HTTPS 配置说明
- 部署步骤和常见问题
更新前端 API 配置:
- api_endpoints.dart: 更新 baseUrl 为 https://rwaapi.szaiai.com
- api_endpoints.dart: 添加 /api/v1 前缀到所有端点
- api_endpoints.dart: 添加 telemetry 遥测端点
- api_client.dart: 更新默认 baseUrl 为生产环境地址
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 20:39:11 -08:00
Developer
a966d71fa0
.
2025-11-30 06:44:57 -08:00
Developer
083db83c96
.
2025-11-29 19:22:42 -08:00