gcx/backend/services
hailin e8d9bdc2fb fix(api): 修复前后端 API 对接 — 响应结构+字段名对齐
端到端审查发现并修复 4 类前后端不匹配问题:

## 1. 响应结构嵌套不匹配
后端返回 `{ data: { user, tokens: { accessToken, refreshToken } } }`
但 miniapp/admin-app/admin-web 均按扁平结构解析

- miniapp services/auth.ts: 新增 AuthResponse→LoginResult 映射层
- miniapp store/auth.ts: 从 `resp.tokens.accessToken` 取 token
- admin-app auth_service.dart: LoginResult.fromJson 优先从 tokens 子对象取
- admin-web auth-context.tsx: 从 `result.tokens.accessToken` 取 token

## 2. 密码登录字段名不匹配
后端 LoginDto 字段为 `identifier`, 但 admin-app 发 `email`, admin-web 发 `email`

- admin-app: `'email' → 'identifier'`
- admin-web: `{ email, password } → { identifier: email, password }`

## 3. 注册 password 字段必填 vs 前端可选
miniapp h5-register 只收集手机+验证码, 不传 password, 会触发 400 校验

- backend RegisterDto: password 改为 @IsOptional
- auth.service.ts: 未传 password 时自动生成随机密码

## 4. miniapp LoginResult 类型导出
- 导出 LoginResult 接口供外部使用

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 21:39:26 -08:00
..
admin-service fix(health): 修正NestJS服务健康检查URL路径 /health → /api/v1/health 2026-02-20 05:50:26 -08:00
ai-service fix(health): 修正NestJS服务健康检查URL路径 /health → /api/v1/health 2026-02-20 05:50:26 -08:00
auth-service fix(api): 修复前后端 API 对接 — 响应结构+字段名对齐 2026-02-23 21:39:26 -08:00
chain-indexer feat(health): 为全部12个微服务添加Docker健康检查 2026-02-20 05:39:25 -08:00
clearing-service fix(health): 修正NestJS服务健康检查URL路径 /health → /api/v1/health 2026-02-20 05:50:26 -08:00
compliance-service fix(health): 修正NestJS服务健康检查URL路径 /health → /api/v1/health 2026-02-20 05:50:26 -08:00
issuer-service feat: 全平台API对齐 — 4个前端应用55+页面接入真实后端API 2026-02-22 22:53:07 -08:00
notification-service fix(health): 修正NestJS服务健康检查URL路径 /health → /api/v1/health 2026-02-20 05:50:26 -08:00
telemetry-service fix(health): 修正NestJS服务健康检查URL路径 /health → /api/v1/health 2026-02-20 05:50:26 -08:00
trading-service feat: 全平台API对齐 — 4个前端应用55+页面接入真实后端API 2026-02-22 22:53:07 -08:00
translate-service feat(health): 为全部12个微服务添加Docker健康检查 2026-02-20 05:39:25 -08:00
user-service feat: 全平台API对齐 — 4个前端应用55+页面接入真实后端API 2026-02-22 22:53:07 -08:00