From 849e0431030791c43fa30bf2ecd6ae12add2140e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=89=E4=BF=AE=E9=BD=8A?= <54578647+siuze@users.noreply.github.com> Date: Fri, 26 Jan 2024 21:59:33 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug:=20=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93type=E5=AD=97=E6=AE=B5=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E5=90=8E=E6=97=A0=E6=B3=95=E6=AD=A3=E7=A1=AE=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=9C=AA=E6=98=BE=E5=BC=8F=E5=AE=9A=E4=B9=89slug?= =?UTF-8?q?=E7=9A=84=E6=96=87=E7=AB=A0=E7=9A=84=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 处理URL之前已经调用过mapProperties(properties),使得字段属性值恢复到标准的英文了,不应当再与自定义配置值进行比对 --- lib/notion/getPageProperties.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/notion/getPageProperties.js b/lib/notion/getPageProperties.js index 3ea1ce28..aca92b25 100644 --- a/lib/notion/getPageProperties.js +++ b/lib/notion/getPageProperties.js @@ -101,11 +101,11 @@ export default async function getPageProperties(id, block, schema, authToken, ta delete properties.content // 处理URL - if (properties.type === BLOG.NOTION_PROPERTY_NAME.type_post) { + if (properties.type === 'Post') { properties.slug = (BLOG.POST_URL_PREFIX) ? generateCustomizeUrl(properties) : (properties.slug ?? properties.id) - } else if (properties.type === BLOG.NOTION_PROPERTY_NAME.type_page) { + } else if (properties.type === 'Page') { properties.slug = properties.slug ?? properties.id - } else if (properties.type === BLOG.NOTION_PROPERTY_NAME.type_menu || properties.type === BLOG.NOTION_PROPERTY_NAME.type_sub_menu) { + } else if (properties.type === 'Menu' || properties.type === 'SubMenu') { // 菜单路径为空、作为可展开菜单使用 properties.to = properties.slug ?? '#' properties.name = properties.title ?? ''