Skip to content

Commit 953a09b

Browse files
authored
Merge pull request #3331 from tangly1024/release/4.8.4
修復无标签编译出错
2 parents 3887845 + 85ca8b1 commit 953a09b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/cache/cache_manager.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export async function getOrSetDataWithCustomCache(
4040
) {
4141
const dataFromCache = await getDataFromCache(key)
4242
if (dataFromCache) {
43-
console.log('[缓存-->>API]:', key)
43+
// console.log('[缓存-->>API]:', key) // 避免过多的缓存日志输出
4444
return dataFromCache
4545
}
4646
const data = await getDataFunction(...getDataArgs)

lib/notion/getAllTags.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function getAllTags({
2828
const AllTagInfos = {}
2929
// 遍历所有文章
3030
allPosts.forEach(post => {
31-
post.tags.forEach(tag => {
31+
post?.tags?.forEach(tag => {
3232
// 如果标签已经存在
3333
if (AllTagInfos[tag]) {
3434
if (

lib/notion/getPostBlocks.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ import { deepClone, delay } from '../utils'
88
import notionAPI from '@/lib/notion/getNotionAPI'
99

1010
/**
11-
* 获取文章内容
11+
* 获取文章内容块
1212
* @param {*} id
1313
* @param {*} from
1414
* @param {*} slice
1515
* @returns
1616
*/
1717
export async function getPage(id, from = null, slice) {
18+
const cacheKey = `page_content_${id}`
1819
return await getOrSetDataWithCache(
19-
`page_content_${id}_${slice}`,
20+
cacheKey,
2021
async (id, slice) => {
21-
const cacheKey = `page_block_${id}`
2222
let pageBlock = await getDataFromCache(cacheKey)
2323
if (pageBlock) {
2424
// console.debug('[API<<--缓存]', `from:${from}`, cacheKey)

0 commit comments

Comments
 (0)