From abebd5d62fbfc5efef0a93ebab4e3486501d1989 Mon Sep 17 00:00:00 2001 From: MT-Fire <798521692@qq.com> Date: Thu, 12 Mar 2026 16:57:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=85=E9=98=85?= =?UTF-8?q?=E8=AF=BB=E6=B2=A1=E6=9C=89=E6=AD=A3=E7=A1=AE=E4=BC=A0=E9=80=92?= =?UTF-8?q?base64=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/app.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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);