diff --git a/lib/cache/cache_manager.js b/lib/cache/cache_manager.js index 90b697f5..28801255 100644 --- a/lib/cache/cache_manager.js +++ b/lib/cache/cache_manager.js @@ -1,33 +1,33 @@ -import { getCacheFromMemory, setCacheToMemory, delCacheFromMemory } from '@/lib/cache/memory_cache' -// import { getCacheFromFile, setCacheToFile, delCacheFromFile } from './local_file_cache' -const enableCache = true // 生产环境禁用 +import { getCacheFromMemory as getCache, setCacheToMemory as setCache, delCacheFromMemory as delCache } from '@/lib/cache/memory_cache' +// import { getCacheFromFile as getCache, setCacheToFile as setCache, delCacheFromFile as delCache } from './local_file_cache' +const enableCache = true /** * 为减少频繁接口请求,notion数据将被缓存 * @param {*} key * @returns */ -export async function getDataFromCache (key) { +export async function getDataFromCache(key) { if (!enableCache) { return null } - const dataFromCache = await getCacheFromMemory(key) + const dataFromCache = await getCache(key) if (JSON.stringify(dataFromCache) === '[]') { return null } return dataFromCache } -export async function setDataToCache (key, data) { +export async function setDataToCache(key, data) { if (!enableCache || !data) { return } - await setCacheToMemory(key, data) + await setCache(key, data) } -export async function delCacheData (key) { +export async function delCacheData(key) { if (!enableCache) { return } - await delCacheFromMemory(key) + await delCache(key) } diff --git a/themes/fukasawa/components/TopNav.js b/themes/fukasawa/components/TopNav.js index 4a9f9e21..8f9bf89e 100644 --- a/themes/fukasawa/components/TopNav.js +++ b/themes/fukasawa/components/TopNav.js @@ -2,6 +2,7 @@ import { useState } from 'react' import Collapse from './Collapse' import GroupMenu from './GroupMenu' import Logo from './Logo' +import SearchInput from './SearchInput' /** * 顶部导航 @@ -21,13 +22,14 @@ const TopNav = props => {