修復无标签编译出错

This commit is contained in:
tangly1024
2025-04-12 08:58:52 +08:00
parent 56fe78e028
commit 85ca8b1da7
3 changed files with 5 additions and 5 deletions

View File

@@ -40,7 +40,7 @@ export async function getOrSetDataWithCustomCache(
) {
const dataFromCache = await getDataFromCache(key)
if (dataFromCache) {
console.log('[缓存-->>API]:', key)
// console.log('[缓存-->>API]:', key) // 避免过多的缓存日志输出
return dataFromCache
}
const data = await getDataFunction(...getDataArgs)

View File

@@ -28,7 +28,7 @@ export function getAllTags({
const AllTagInfos = {}
// 遍历所有文章
allPosts.forEach(post => {
post.tags.forEach(tag => {
post?.tags?.forEach(tag => {
// 如果标签已经存在
if (AllTagInfos[tag]) {
if (

View File

@@ -8,17 +8,17 @@ import { deepClone, delay } from '../utils'
import notionAPI from '@/lib/notion/getNotionAPI'
/**
* 获取文章内容
* 获取文章内容
* @param {*} id
* @param {*} from
* @param {*} slice
* @returns
*/
export async function getPage(id, from = null, slice) {
const cacheKey = `page_content_${id}`
return await getOrSetDataWithCache(
`page_content_${id}_${slice}`,
cacheKey,
async (id, slice) => {
const cacheKey = `page_block_${id}`
let pageBlock = await getDataFromCache(cacheKey)
if (pageBlock) {
// console.debug('[API<<--缓存]', `from:${from}`, cacheKey)