From 780bb26e5e498e7e2cb0bf8119246a975155c0fa Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 6 Jul 2023 10:35:24 +0800 Subject: [PATCH] =?UTF-8?q?hotfix.=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E7=94=A8=E5=AF=86=E7=A0=81=E8=AE=BF=E9=97=AE=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/notion/getPageProperties.js | 2 +- pages/[...slug].js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/notion/getPageProperties.js b/lib/notion/getPageProperties.js index 1394ccad..7c47462f 100644 --- a/lib/notion/getPageProperties.js +++ b/lib/notion/getPageProperties.js @@ -90,7 +90,6 @@ export default async function getPageProperties(id, block, schema, authToken, ta properties.pageCover = mapImgUrl(block[id].value?.format?.page_cover, block[id].value) ?? '' properties.pageCoverThumbnail = mapImgUrl(block[id].value?.format?.page_cover, block[id].value, 'block', 'pageCoverThumbnail') ?? '' properties.content = value.content ?? [] - properties.password = properties.password ? md5(properties.slug + properties.password) : '' properties.tagItems = properties?.tags?.map(tag => { return { name: tag, color: tagOptions?.find(t => t.value === tag)?.color || 'gray' } }) || [] @@ -106,6 +105,7 @@ export default async function getPageProperties(id, block, schema, authToken, ta properties.to = properties.slug ?? null properties.name = properties.title ?? '' } + properties.password = properties.password ? md5(properties.slug + properties.password) : '' return properties } diff --git a/pages/[...slug].js b/pages/[...slug].js index df93576c..65be2306 100644 --- a/pages/[...slug].js +++ b/pages/[...slug].js @@ -28,6 +28,7 @@ const Slug = props => { */ const validPassword = passInput => { const encrypt = md5(post.slug + passInput) + console.log('passInput', passInput, post.slug) if (passInput && encrypt === post.password) { setLock(false) return true