From a67e9086a0efbc3a5dc42d451f7d5aaf539f0282 Mon Sep 17 00:00:00 2001 From: LooseLi <1329307562@qq.com> Date: Tue, 15 Apr 2025 10:47:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=EF=BC=9A=E4=BB=85=E5=AF=B9=20attachment?= =?UTF-8?q?=20=E5=BC=80=E5=A4=B4=E7=9A=84=E4=B8=8A=E4=BC=A0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=AD=BE=E5=90=8D=EF=BC=8C=E8=B7=B3=E8=BF=87=20embed?= =?UTF-8?q?=20=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/notion/getPostBlocks.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/notion/getPostBlocks.js b/lib/notion/getPostBlocks.js index fb486d61..97b70af7 100644 --- a/lib/notion/getPostBlocks.js +++ b/lib/notion/getPostBlocks.js @@ -143,7 +143,8 @@ function convertNotionBlocksToPost(id, blockMap, slice) { b?.value?.type === 'pdf' || b?.value?.type === 'video' || b?.value?.type === 'audio') && - b?.value?.properties?.source?.[0][0] + b?.value?.properties?.source?.[0][0] && + b?.value?.properties?.source?.[0][0].indexOf('attachment') === 0 ) { const oldUrl = b?.value?.properties?.source?.[0][0] const newUrl = `https://notion.so/signed/${encodeURIComponent(oldUrl)}?table=block&id=${b?.value?.id}` From 91493bda00446e33349dd1a7d3b7565054092a3d Mon Sep 17 00:00:00 2001 From: LooseLi <1329307562@qq.com> Date: Wed, 16 Apr 2025 09:46:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E6=97=A7=E7=9A=84?= =?UTF-8?q?=20AWS=20=E9=93=BE=E6=8E=A5=E6=A0=BC=E5=BC=8F=E4=BB=A5=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E6=97=A7=E6=96=87=E4=BB=B6=E6=AD=A3=E5=B8=B8=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/notion/getPostBlocks.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/notion/getPostBlocks.js b/lib/notion/getPostBlocks.js index 97b70af7..0b0e50e7 100644 --- a/lib/notion/getPostBlocks.js +++ b/lib/notion/getPostBlocks.js @@ -139,12 +139,10 @@ function convertNotionBlocksToPost(id, blockMap, slice) { // 如果是文件,或嵌入式PDF,需要重新加密签名 if ( - (b?.value?.type === 'file' || - b?.value?.type === 'pdf' || - b?.value?.type === 'video' || - b?.value?.type === 'audio') && + ['file', 'pdf', 'video', 'audio'].includes(b?.value?.type) && b?.value?.properties?.source?.[0][0] && - b?.value?.properties?.source?.[0][0].indexOf('attachment') === 0 + (b?.value?.properties?.source?.[0][0].indexOf('attachment') === 0 || + b?.value?.properties?.source?.[0][0].indexOf('amazonaws.com') > 0) ) { const oldUrl = b?.value?.properties?.source?.[0][0] const newUrl = `https://notion.so/signed/${encodeURIComponent(oldUrl)}?table=block&id=${b?.value?.id}`