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] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E6=97=A7=E7=9A=84=20A?= =?UTF-8?q?WS=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}`