From 3f62fe903fadf13759e882d15804fa8569b0fd5a Mon Sep 17 00:00:00 2001 From: LaoWang <257199637@qq.com> Date: Tue, 2 Jun 2026 13:59:27 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=91=E6=96=87=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E6=89=93=E5=BC=80iframe=EF=BC=8C=E4=B8=8D=E5=86=8D=E9=A2=84?= =?UTF-8?q?=E6=A3=80HEAD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/app.js | 10 ++++------ static/index.html | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/static/app.js b/static/app.js index 6b5d573..ff0f0fd 100644 --- a/static/app.js +++ b/static/app.js @@ -174,13 +174,11 @@ function getPdfLink(p) { function openPdfBtn(btn) { openPdf(btn.dataset.pdf, btn.dataset.title); } -async function openTrans(btn) { +function openTrans(btn) { const url = btn.dataset.pdf; - try { - const resp = await fetch(url, { method: 'HEAD' }); - if (resp.ok) { openPdf(url, btn.dataset.title); return; } - } catch(e) {} - alert('该论文译文尚未生成,请稍后再试'); + const title = btn.dataset.title; + openPdf(url, title); + // If translation doesn't exist, the iframe will show error - user can see it } // ═══════════════ PDF VIEWER (状态条驱动) ═══════════════ diff --git a/static/index.html b/static/index.html index 0e6a2e4..a4c8337 100644 --- a/static/index.html +++ b/static/index.html @@ -207,13 +207,11 @@ function getPdfLink(p) { function openPdfBtn(btn) { openPdf(btn.dataset.pdf, btn.dataset.title); } -async function openTrans(btn) { +function openTrans(btn) { const url = btn.dataset.pdf; - try { - const resp = await fetch(url, { method: 'HEAD' }); - if (resp.ok) { openPdf(url, btn.dataset.title); return; } - } catch(e) {} - alert('该论文译文尚未生成,请稍后再试'); + const title = btn.dataset.title; + openPdf(url, title); + // If translation doesn't exist, the iframe will show error - user can see it } // ═══════════════ PDF VIEWER (状态条驱动) ═══════════════