From 66ce9b9411dda05df2f2da2b45d5eac20fe90f37 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 7 Sep 2023 16:10:48 +0800 Subject: [PATCH] =?UTF-8?q?PDF=20=E5=B5=8C=E5=85=A5BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/notion/getPostBlocks.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/notion/getPostBlocks.js b/lib/notion/getPostBlocks.js index be228594..a9e3a757 100644 --- a/lib/notion/getPostBlocks.js +++ b/lib/notion/getPostBlocks.js @@ -101,8 +101,8 @@ function filterPostBlocks(id, pageBlock, slice) { } } - // 如果是文件,需要重新加密签名 - if (b?.value?.type === 'file' && b?.value?.properties?.source?.[0][0]) { + // 如果是文件,或嵌入式PDF,需要重新加密签名 + if ((b?.value?.type === 'file' || b?.value?.type === 'pdf') && b?.value?.properties?.source?.[0][0]) { const oldUrl = b?.value?.properties?.source?.[0][0] const newUrl = `https://notion.so/signed/${encodeURIComponent(oldUrl)}?table=block&id=${b?.value?.id}` b.value.properties.source[0][0] = newUrl