GlobalJS,GlobalStyle

This commit is contained in:
tangly1024
2024-01-21 20:12:57 +08:00
parent 1d7a4342eb
commit 93be76e008
4 changed files with 64 additions and 31 deletions

View File

@@ -9,7 +9,7 @@ import BLOG from '@/blog.config'
* @returns
*/
export async function getDataFromCache(key, force) {
if (BLOG.ENABLE_CACHE || force) {
if (JSON.parse(BLOG.ENABLE_CACHE) || force) {
const dataFromCache = await getApi().getCache(key)
if (JSON.stringify(dataFromCache) === '[]') {
return null
@@ -28,7 +28,7 @@ export async function setDataToCache(key, data) {
}
export async function delCacheData(key) {
if (!BLOG.ENABLE_CACHE) {
if (!JSON.parse(BLOG.ENABLE_CACHE)) {
return
}
await getApi().delCache(key)