在知识库管理页面中添加调试信息以便于后续排查,同时优化获取知识库文章详情的API响应格式,提升用户体验和代码可维护性。

This commit is contained in:
zyh
2025-04-11 16:01:37 +00:00
parent f6074e929d
commit a5cfee4338
2 changed files with 2 additions and 2 deletions

View File

@@ -126,7 +126,7 @@ export const KnowInfoPage = () => {
// 处理编辑
const handleEdit = async (id: number) => {
const article = await fetchArticle(id);
console.log('article', article)
if (article) {
setFormMode('edit');
setEditingId(id);

View File

@@ -103,7 +103,7 @@ export function createKnowInfoRoutes(withAuth: WithAuth) {
return c.json({ error: "文章不存在" }, 404);
}
return c.json(article);
return c.json({message: '获取知识库文章详情成功', data: article});
} catch (error) {
log.api("获取知识库文章详情失败:", error);
return c.json({ error: "获取知识库文章详情失败" }, 500);