From 9db27468e8307411a55178885d6162ce752485ff Mon Sep 17 00:00:00 2001 From: ShH Y <74806550+1208nn@users.noreply.github.com> Date: Sat, 9 Dec 2023 15:07:34 +0800 Subject: [PATCH] fix --- lib/notion/getNotionConfig.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/notion/getNotionConfig.js b/lib/notion/getNotionConfig.js index 23ccba64..62e78914 100644 --- a/lib/notion/getNotionConfig.js +++ b/lib/notion/getNotionConfig.js @@ -32,13 +32,14 @@ export async function getConfigMapFromConfigPage(allPages) { return null } const configPageId = configPage.id - - for (const table of ['config-table', 'Config-Table', 'CONFIG-TABLE']) { - // console.log('[Notion配置]请求配置数据 ', configPage.id) - var pageRecordMap = await getPostBlocks(configPageId, table) - // console.log('配置中心Page', configPageId, pageRecordMap) - var content = pageRecordMap.block[configPageId].value.content + // console.log('[Notion配置]请求配置数据 ', configPage.id) + var pageRecordMap = await getPostBlocks(configPageId, 'config-table') + // console.log('配置中心Page', configPageId, pageRecordMap) + var content = pageRecordMap.block[configPageId].value.content + for (const table of ['Config-Table', 'CONFIG-TABLE']) { if (content) break + pageRecordMap = await getPostBlocks(configPageId, table) + content = pageRecordMap.block[configPageId].value.content } if (!content) { @@ -122,9 +123,9 @@ export async function getConfigMapFromConfigPage(allPages) { if (properties) { // 将表格中的字段映射成 英文 const config = { - enable: properties['启用'] || properties['Enable'] === 'Yes', - key: properties['配置名'] || properties['Name'], - value: properties['配置值'] || properties['Value'] + enable: properties['启用'] || properties.Enable === 'Yes', + key: properties['配置名'] || properties.Name, + value: properties['配置值'] || properties.Value } // 只导入生效的配置