From 8336bc9480e756a77b2d921a44a697259d7c007e Mon Sep 17 00:00:00 2001 From: sophie <16087569+sophie_liang@user.noreply.gitee.com> Date: Fri, 17 Apr 2026 18:26:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20feedback=20500=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=92=8C=E5=A4=9A=E4=BD=99=E6=B0=94=E6=B3=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/api/chat.py | 6 +-- frontend/src/components/FilePreviewModal.vue | 10 ++--- frontend/src/composables/useChat.ts | 43 ++++++++++++-------- frontend/src/views/ChatView.vue | 20 ++++++++- 4 files changed, 54 insertions(+), 25 deletions(-) diff --git a/backend/app/api/chat.py b/backend/app/api/chat.py index 0dbd56cf..095996f3 100644 --- a/backend/app/api/chat.py +++ b/backend/app/api/chat.py @@ -253,12 +253,12 @@ def submit_feedback(): return jsonify({'error': 'Missing user or agent context'}), 500 # 构造查询:限定在当前用户和 Agent 范围内 - query = ChatLog.query.filter_by(user_id=user.id, agent_id=agent.id) + chat_logs_query = db.session.query(ChatLog).filter_by(user_id=user.id, agent_id=agent.id) if conversation_id: - query = query.filter_by(conversation_id=conversation_id) + chat_logs_query = chat_logs_query.filter_by(conversation_id=conversation_id) # 取最新一条对话日志 - chat_log = query.order_by(ChatLog.created_at.desc()).first() + chat_log = chat_logs_query.order_by(ChatLog.created_at.desc()).first() if not chat_log: return jsonify({'error': 'ChatLog not found'}), 404 diff --git a/frontend/src/components/FilePreviewModal.vue b/frontend/src/components/FilePreviewModal.vue index d5c655e7..82b21d08 100644 --- a/frontend/src/components/FilePreviewModal.vue +++ b/frontend/src/components/FilePreviewModal.vue @@ -345,13 +345,13 @@ watch( -
+