diff --git a/js/app.js b/js/app.js index 4739c50..e22ae8c 100644 --- a/js/app.js +++ b/js/app.js @@ -2241,9 +2241,19 @@ async function handleReadClick() { batchTotal: null, batchTemplate: null, batchFormats: null, - batchStartedAt: null + batchStartedAt: null, + // 对于 PDF 文件,将 base64 也存入 metadata.originalPdfBase64 + // 以便历史详情页面能够正确显示PDF + metadata: fileType === 'pdf' ? { originalPdfBase64: base64Content } : null }; + console.log('[仅阅读] 保存记录:', { + id: recordId, + fileType, + hasMetadata: !!record.metadata, + hasOriginalPdfBase64: !!(record.metadata && record.metadata.originalPdfBase64) + }); + // 保存到数据库 if (typeof window.storageAdapter !== 'undefined' && typeof window.storageAdapter.saveResultToDB === 'function') { await window.storageAdapter.saveResultToDB(record);