debug: purchase 分支和 POST 入口加 attachments 日志
- POST /api/rooms/:roomId/messages 入口打印收到的 attachments - handleAIResult purchase 分支开头打印 attachments 值 - 用于定位附件关联失败的具体环节
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user