- Create .fixes/ directory structure for tracking repairs - Add FIX-001 to FIX-009 repair tasks based on Cursor review - Add automation scripts (start-fix.sh, complete-fix.sh) - Update HEARTBEAT.md with repair checklist - Create AUTOMATION_PLAN.md with workflow documentation Fixes address: - Remove fake initial data - Add clear chat button - Split oversized component - Optimize multi-image upload - Fix scroll behavior - Remove dead code - Extract hardcoded config
52 lines
1.1 KiB
Markdown
52 lines
1.1 KiB
Markdown
# FIX-001: 移除初始假数据
|
||
|
||
**状态**: 待开始
|
||
**创建时间**: 2026-02-28
|
||
**优先级**: 高
|
||
**负责人**: msh-agent
|
||
|
||
---
|
||
|
||
## 问题描述
|
||
|
||
当前 `ai-nutritionist.vue` 页面 `data()` 中 `messageList` 数组包含两条写死的示例消息(用户问香蕉、AI回答),用户首次进入会误以为有历史对话记录。
|
||
|
||
### 当前行为
|
||
页面加载后自动显示两条假对话消息。
|
||
|
||
### 预期行为
|
||
首次进入时 `messageList` 为空,仅显示欢迎语(欢迎语固定在模板中)。
|
||
|
||
---
|
||
|
||
## 修复方案
|
||
|
||
**方案A(推荐)**:将 `messageList` 初始值设为空数组 `[]`,保留欢迎语在模板中的展示。
|
||
|
||
---
|
||
|
||
## 实施步骤
|
||
|
||
- [ ] 1. 备份原文件
|
||
- [ ] 2. 修改 `data()` 中 `messageList: []`
|
||
- [ ] 3. 本地 H5 测试
|
||
- [ ] 4. 微信小程序测试
|
||
- [ ] 5. 提交代码
|
||
|
||
---
|
||
|
||
## 文件变更
|
||
|
||
修改 `pages/tool/ai-nutritionist.vue` 第 115-128 行:
|
||
|
||
```javascript
|
||
// 修改前
|
||
messageList: [
|
||
{ role: 'user', content: '我今天想吃香蕉,可以吗?', type: 'text' },
|
||
{ role: 'ai', content: '香蕉含钾量较高...', type: 'text' }
|
||
]
|
||
|
||
// 修改后
|
||
messageList: []
|
||
```
|