主色加入蓝色;
缓存读取日志
This commit is contained in:
tangly1024
2021-12-08 13:36:39 +08:00
parent c4a7fa3b86
commit 980531b1ee
10 changed files with 40 additions and 23 deletions

View File

@@ -12,7 +12,10 @@ import { getPostBlocks } from '@/lib/notion/getPostBlocks'
export async function getNotionPageData ({ pageId = BLOG.notionPageId, from }) {
// 尝试从缓存获取
const data = await getDataFromCache('page_record_map_' + pageId)
if (data) return data
if (data) {
console.log('[请求缓存]:', `from:${from}`, `id:${pageId}`)
return data
}
const pageRecordMap = await getPageRecordMapByNotionAPI({ pageId, from })
// 存入缓存
if (pageRecordMap) {

View File

@@ -5,6 +5,7 @@ import { getDataFromCache, setDataToCache } from '@/lib/cache/cache_manager'
export async function getPostBlocks (id, from) {
let pageBlock = await getDataFromCache('page_block_' + id)
if (pageBlock) {
console.log('[请求缓存]:', `from:${from}`, `id:${id}`)
return pageBlock
}
const authToken = BLOG.notionAccessToken || null