Files
msh-system/scripts/logs/agent-BUG-001-102447.log
scottpan 4be53dcd1b feat: 集成 KieAI 服务,移除 models-integration 子项目
- 添加 Gemini 2.5 Flash 对话接口(流式+非流式)
- 添加 NanoBanana 图像生成/编辑接口
- 添加 Sora2 视频生成接口(文生视频、图生视频、去水印)
- 移除 models-integration 子项目(功能已迁移至主后端)
- 新增测试文档和 Playwright E2E 配置
- 更新前端页面和 API 接口
- 更新后端配置和日志处理
2026-03-03 15:33:50 +08:00

33 lines
1.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
已按 BUG-001 的两个子问题改好,修改总结如下。
---
**子问题 A — 打卡前积分不提前跳变**
- **逻辑**:在 `handleCheckin` 里,**只有**在 `setSignIntegral()` 成功返回之后才更新状态和积分。
- **具体**
- 先 `await setSignIntegral()`,不成功会进 `catch`,不会改 `currentPoints`。
- 成功后再 `this.todaySigned = true`,然后再用服务端数据更新 `currentPoints`。
- 全程没有在接口成功前修改 `currentPoints`,也没有任何前端本地 `+30`。
---
**子问题 B — 打卡成功后用服务端积分刷新**
- **接口确认**:打卡接口仍是 `setSignIntegral()``user/sign/integral`),对应后端 `/api/front/user/sign/integral`,即签到/打卡接口。
- **刷新积分**:打卡成功后用「用户信息」接口刷新积分:
- 先调 `getUserInfo()`(即 GET `/api/front/user`,即 user info 接口)。
- 从返回里取 `integral` 或 `points`,赋给 `currentPoints`(优先 `integral`)。
- 若 user info 里没有积分字段,再请求 `getUserPoints()``tool/points/info`),用其返回的 `totalPoints` / `points` / `availablePoints` 更新 `currentPoints`。
- **禁止硬编码**:积分只来自上述两个接口的返回值,没有写死 `+30`。
---
**代码改动要点**
1. 引入并调用 `getUserInfo`。
2. 在 `await setSignIntegral()` 成功后,先 `getUserInfo()`,用 `userRes.data.integral ?? userRes.data.points` 更新 `currentPoints`。
3. 仅当 user info 无积分时,再 `getUserPoints()` 并以其结果更新 `currentPoints`。
4. 注释中写明:不在 API 成功前改 `currentPoints`,且用 GET user info 刷新积分、禁止前端本地 +30。