Update server.js via upload script - 2026-08-07 17:20:47

This commit is contained in:
mike 2026-08-07 17:21:04 +08:00
parent 112597ada3
commit f655d7cfd7
1 changed files with 5 additions and 0 deletions

View File

@ -914,6 +914,11 @@ app.post('/api/ai/parse-catalog', requireAuth, aiLimiter, (req, res) => {
brand: hintBrand || p.brand,
type: hintType || p.type,
}));
finalProducts.forEach(fp => {
if (Array.isArray(fp.extraSpecs) && fp.extraSpecs.length) {
console.log('[AI导入] extraSpecs for', fp.name, ':', JSON.stringify(fp.extraSpecs));
}
});
res.json({ products: finalProducts, ocrTextLength: text.length, truncated });
} catch (e) {
const hint = /empty response/i.test(e.message)