From fb07144ef3827c193708b95aca5e54644d1f61d7 Mon Sep 17 00:00:00 2001 From: kicer Date: Wed, 22 Jul 2026 16:04:41 +0800 Subject: [PATCH] =?UTF-8?q?debug:=20purchase=20=E5=88=86=E6=94=AF=E5=92=8C?= =?UTF-8?q?=20POST=20=E5=85=A5=E5=8F=A3=E5=8A=A0=20attachments=20=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - POST /api/rooms/:roomId/messages 入口打印收到的 attachments - handleAIResult purchase 分支开头打印 attachments 值 - 用于定位附件关联失败的具体环节 --- server/server.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/server.js b/server/server.js index d75d931..020f008 100644 --- a/server/server.js +++ b/server/server.js @@ -163,6 +163,7 @@ app.get('/api/rooms/:roomId/messages', auth, (req, res) => { app.post('/api/rooms/:roomId/messages', auth, async (req, res) => { const { text, attachments } = req.body; + console.log('📨 收到消息, text:', (text||'').substring(0,30), 'attachments:', JSON.stringify(attachments)); const roomId = req.params.roomId; const username = req.user.username; const now = timestamp(); @@ -439,6 +440,7 @@ function handleAIResult(aiResult, roomId, username, originalText, attachments) { return; } if (aiResult.action === 'purchase') { + console.log('🛒 purchase 分支, attachments:', JSON.stringify(attachments)); // 引用最近图片:用户要求把之前的图片关联到某采购 let usedRecentImage = false; if (aiResult.use_recent_image) {