fix: 修复第二轮回归发现的已知 BUG

## 修复清单

### 后端路由修复
1.  — 新增 GET 路由与现有 POST 并存
   - 前端 widget.html 原使用 GET 调用但路由仅注册 POST,导致 404
   - 修复: 注册 GET + POST 双路由,handler 支持 query param + JSON body

### 前端修复
2.  — Config 调用方式修正
   - GET /api/v1/widget/config?website_token= → POST /api/v1/widget/config
   - 发送 JSON body: {"website_token":"..."}
   - 后端 Config handler 已同时支持两种调用方式

### 文档更新
3. 修正测试计划 §13.7 已知未实现端点状态
   - 标记 4 项已验证正常(copilot/config、agent_bot_inboxes/、reports/overview)
   - 标记 2 项已修复(widget/config GET+POST)
   - 保留 1 项 P3 未实现(conversation_workflows 需完整 CRUD handler)

### 已验证非 BUG 项
- 仪表盘会话计数的0问题:实际显示 1/13/14 ✅(之前为 stale snapshot)
- 会话列表为空:filter status=open 过滤掉 snoozed 会话 ✅(设计如此)
- Reports API:正确路由 /reports?metric=&since=&until= ✅
This commit is contained in:
Rogee
2026-07-28 21:46:53 +08:00
parent c3fbb9b908
commit dccd4b93f7
3 changed files with 15 additions and 7 deletions
+3 -2
View File
@@ -69,7 +69,8 @@
portal: null,
};
var xhr = new XMLHttpRequest();
xhr.open('GET', '/api/v1/widget/config?website_token=' + websiteToken, true);
xhr.open('POST', '/api/v1/widget/config', true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onload = function() {
if (xhr.status === 200) {
try {
@@ -89,7 +90,7 @@
} catch(e) {}
}
};
xhr.send();
xhr.send('{"website_token":"' + websiteToken + '"}');
})();
})();
</script>