减小NEXT_DATA体积

This commit is contained in:
tangly1024.com
2024-05-16 11:04:35 +08:00
parent 84f36a712f
commit 71701fa314
7 changed files with 120 additions and 67 deletions

View File

@@ -9,7 +9,7 @@
import { getDateValue, getTextContent } from 'notion-utils'
import { deepClone } from '../utils'
import getAllPageIds from './getAllPageIds'
import { getPostBlocks } from './getPostBlocks'
import { getPage } from './getPostBlocks'
/**
* 从Notion中读取Config配置表
@@ -41,12 +41,12 @@ export async function getConfigMapFromConfigPage(allPages) {
}
const configPageId = configPage.id
// console.log('[Notion配置]请求配置数据 ', configPage.id)
let pageRecordMap = await getPostBlocks(configPageId, 'config-table')
let pageRecordMap = await getPage(configPageId, 'config-table')
// console.log('配置中心Page', configPageId, pageRecordMap)
let content = pageRecordMap.block[configPageId].value.content
for (const table of ['Config-Table', 'CONFIG-TABLE']) {
if (content) break
pageRecordMap = await getPostBlocks(configPageId, table)
pageRecordMap = await getPage(configPageId, table)
content = pageRecordMap.block[configPageId].value.content
}