gcx/frontend/admin-web
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
..
nginx chore: Switch domain from admin.gogenex.com to admin.gogenex.cn 2026-02-11 05:18:22 -08:00
public fix(branding): 统一Logo色调与App主色调 #6C5CE7 2026-02-23 18:12:35 -08:00
src fix(api): 修复前后端 API 对接 — 响应结构+字段名对齐 2026-02-23 21:39:26 -08:00
.dockerignore chore: Add Next.js project config and app entry for admin-web 2026-02-11 01:35:19 -08:00
.env.development chore: Add Docker deployment config for admin-web 2026-02-11 01:22:22 -08:00
.env.production chore: Add Docker deployment config for admin-web 2026-02-11 01:22:22 -08:00
.gitignore chore: Add Next.js project config and app entry for admin-web 2026-02-11 01:35:19 -08:00
DEPLOY.md chore: Switch domain from admin.gogenex.com to admin.gogenex.cn 2026-02-11 05:18:22 -08:00
Dockerfile fix: Make Dockerfile tolerant of missing package-lock.json 2026-02-11 01:39:14 -08:00
deploy.sh chore: Switch domain from admin.gogenex.com to admin.gogenex.cn 2026-02-11 05:18:22 -08:00
docker-compose.yml chore: Add Docker deployment config for admin-web 2026-02-11 01:22:22 -08:00
next.config.ts chore: Add Next.js project config and app entry for admin-web 2026-02-11 01:35:19 -08:00
package-lock.json feat: Wire all view components to Next.js App Router routes 2026-02-11 05:37:28 -08:00
package.json chore: Add Next.js project config and app entry for admin-web 2026-02-11 01:35:19 -08:00
tsconfig.json chore: Add Next.js project config and app entry for admin-web 2026-02-11 01:35:19 -08:00