mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
fix
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
// 只导入生效的配置
|
||||
|
||||
Reference in New Issue
Block a user