修复登录失败原因提示
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 5m18s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 5m26s
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 5m37s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 5m51s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m36s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m20s
Project CI / Repository checks (pull_request) Successful in 3m48s
Project CI / Frontend tests (pull_request) Successful in 5m2s
Project CI / Native shell tests (pull_request) Successful in 7m24s
Project CI / Backend tests (pull_request) Successful in 7m53s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m6s

统一错误解析器支持字符串 error 响应

补充登录错误原因回归测试

同步认证排障记忆
This commit is contained in:
2026-09-15 19:10:12 +08:00
parent 2111078483
commit bbdedfcea7
3 changed files with 55 additions and 8 deletions
@@ -5596,3 +5596,10 @@ Cocos Creator 根目录由 `package.json.creator.version` 与普通 `assets/`
- 原因:健康检查只能证明“有服务响应”,不能证明服务属于当前工作树;旧 `.app/dev-stack.json` 可能没有当前 `repoRoot``instanceId` 和服务级 dataDir 身份。
- 处理:先读取 `.app/dev-stack.json`,核对顶层 `repoRoot + instanceId`,再核对服务 `repoRoot + instanceId + dataDir + pid + port`AGC Vite marker 还必须带 `repoRoot + processId + port`。任何字段缺失或不匹配都拒绝静默复用,改为启动当前工作树自己的服务或明确提示清理。
- 验证:`scripts/dev.test.ts``apps/ai-game-creator-shell/tests/start-dev-stack.test.ts` 覆盖 snapshot identity 和旧状态拒绝复用;运行时记录实际端口、进程命令行和 dataDir,不要只记录 HTTP 200。
## 2026-09-15 登录失败提示必须保留接口返回原因
- **现象**:账号登录失败时页面只显示“登录失败”,用户无法判断是手机号、验证码、密码还是服务状态问题。
- **原因**:统一错误解析器只处理标准 `error.message/details` 结构;部分网关或旧兼容响应使用字符串 `error`,解析失败后回落到登录接口传入的通用文案。
- **处理**`parseApiErrorMessage` 同时支持字符串 `error`,标准嵌套结构保持原有优先级;未知或空响应继续使用通用兜底。
- **验证**`src/services/apiClient.test.ts` 新增字符串错误响应回归用例,定向测试 32 项通过,`npm run typecheck` 通过。