Update server.js via upload script - 2026-08-07 16:31:40

This commit is contained in:
mike 2026-08-07 16:31:59 +08:00
parent 96ed7e7d92
commit 1902a53e8b
1 changed files with 1 additions and 0 deletions

View File

@ -872,6 +872,7 @@ app.post('/api/ai/parse-catalog', requireAuth, aiLimiter, (req, res) => {
const ocrText = imagePaths.length ? await ocrImages(imagePaths) : '';
const text = [ocrText, ...htmlTextParts].filter(Boolean).join('\n\n--- 下一份文件 ---\n\n');
console.log('[AI导入] OCR文本长度:', text.length, '| 含"应用":', text.includes('应用'), '| 含"20尺柜":', text.includes('20尺柜'), '| 含"装箱":', text.includes('装箱'));
if (!text) return res.status(400).json({ error: '没有识别/读取到任何文字内容,请确认文件清晰、内容完整' });
// 识别出来的文本太长就截断,避免超出模型输出预算;产品目录类文档核心信息通常靠前