gcx/frontend/admin-app
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
..
android fix(branding): 重新生成全平台图标 — 基于更新后的Logo SVG v2 2026-02-22 08:00:19 -08:00
assets/images fix(branding): 统一Logo色调与App主色调 #6C5CE7 2026-02-23 18:12:35 -08:00
ios fix(branding): 重新生成全平台图标 — 基于更新后的Logo SVG v2 2026-02-22 08:00:19 -08:00
lib fix(api): 修复前后端 API 对接 — 响应结构+字段名对齐 2026-02-23 21:39:26 -08:00
.gitignore feat: Add Flutter build configuration for admin-app and mobile 2026-02-11 06:22:13 -08:00
.metadata feat: Add Flutter build configuration for admin-app and mobile 2026-02-11 06:22:13 -08:00
analysis_options.yaml feat: Add Flutter build configuration for admin-app and mobile 2026-02-11 06:22:13 -08:00
pubspec.yaml feat(branding): 全平台品牌Logo替换 — 新双色渐变券印标识 2026-02-22 04:07:46 -08:00