From b5fd54a72ac64cea1556843c5c883bfd8d528ff6 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 7 Sep 2023 15:54:57 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=B9=BF=E5=91=8A=E4=BD=8D=E9=AB=98?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/WWAds.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/WWAds.js b/components/WWAds.js index f2290a75..87901f39 100644 --- a/components/WWAds.js +++ b/components/WWAds.js @@ -13,6 +13,6 @@ export default function WWAds({ orientation = 'vertical', sticky = false, classN } return ( -
+
) } From 9b29c0d82d3adfc80f74440bbff0934929c7a7b5 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 7 Sep 2023 16:00:54 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B0=E7=89=88Notion?= =?UTF-8?q?=E4=B8=AD=E9=99=84=E4=BB=B6=E6=96=87=E4=BB=B6=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=89=93=E5=BC=80=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/notion/getPostBlocks.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/notion/getPostBlocks.js b/lib/notion/getPostBlocks.js index ca3090dd..be228594 100644 --- a/lib/notion/getPostBlocks.js +++ b/lib/notion/getPostBlocks.js @@ -63,6 +63,7 @@ export async function getPageWithRetry(id, from, retryAttempts = 3) { /** * 获取到的blockMap删除不需要的字段 + * 并且对于页面内容进行特殊处理,比如文件url格式化 * @param {*} id 页面ID * @param {*} pageBlock 页面元素 * @param {*} slice 截取数量 @@ -72,6 +73,7 @@ function filterPostBlocks(id, pageBlock, slice) { const clonePageBlock = deepClone(pageBlock) let count = 0 + // 循环遍历文档的每个block for (const i in clonePageBlock?.block) { const b = clonePageBlock?.block[i] if (slice && slice > 0 && count > slice) { @@ -99,6 +101,13 @@ function filterPostBlocks(id, pageBlock, slice) { } } + // 如果是文件,需要重新加密签名 + if (b?.value?.type === 'file' && 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 + } + delete b?.role delete b?.value?.version delete b?.value?.created_by_table From 66ce9b9411dda05df2f2da2b45d5eac20fe90f37 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 7 Sep 2023 16:10:48 +0800 Subject: [PATCH 3/4] =?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 From 232d2aade518276e2d63e1f954343e976079821d Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 7 Sep 2023 16:12:43 +0800 Subject: [PATCH 4/4] 4.0.15 --- .env.local | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.local b/.env.local index 98021d01..ad3056e7 100644 --- a/.env.local +++ b/.env.local @@ -1,2 +1,2 @@ # 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables -NEXT_PUBLIC_VERSION=4.0.14 \ No newline at end of file +NEXT_PUBLIC_VERSION=4.0.15 \ No newline at end of file diff --git a/package.json b/package.json index 805747eb..690ff400 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "notion-next", - "version": "4.0.14", + "version": "4.0.15", "homepage": "https://github.com/tangly1024/NotionNext.git", "license": "MIT", "repository": {