From 978b618df2994cc25d96426121b3c6bee0c30308 Mon Sep 17 00:00:00 2001 From: hehh Date: Thu, 4 Dec 2025 19:30:57 +0800 Subject: [PATCH] =?UTF-8?q?refactor(config):=20=E7=BB=9F=E4=B8=80=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E9=94=AE=E5=91=BD=E5=90=8D=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E8=AE=BE=E7=BD=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将缓存键名从带版本后缀的形式统一为无版本后缀 - 更新主题设置与读取逻辑,使用配置中心的缓存键定义 - 修正语言检测时对中文标识的判断逻辑 - 优化页面脚本加载顺序,确保配置文件优先加载 - 调整主题显示文本的中英文切换条件判断表达式 --- js/about.js | 2 +- js/config.js | 6 +++--- me.html | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/js/about.js b/js/about.js index d8caa9c..5637715 100644 --- a/js/about.js +++ b/js/about.js @@ -13,7 +13,7 @@ function getStoredLanguage() { // 公共方法:设置本地存储的主题设置 function setStoredTheme(theme) { - const cacheKey = window.SiteConfig?.cacheKeys?.theme?.key || 'theme-v2'; + const cacheKey = window.SiteConfig?.cacheKeys?.theme?.key || 'theme'; localStorage.setItem(cacheKey, JSON.stringify({ value: theme, time: new Date().getTime() })); diff --git a/js/config.js b/js/config.js index 480ff8c..634514d 100644 --- a/js/config.js +++ b/js/config.js @@ -43,9 +43,9 @@ const SiteConfig = { // 通用缓存键与TTL(毫秒) cacheKeys: { - github: { key: 'gh_data_v2', ttlMs: 36000000 }, - blog: { key: 'blog_data_v2', ttlMs: 3600000 }, - theme: { key: 'theme_v2', ttlMs: 3600000 } + github: { key: 'gh_data', ttlMs: 36000000 }, + blog: { key: 'blog_data', ttlMs: 3600000 }, + theme: { key: 'theme', ttlMs: 3600000 } }, techStack: [ diff --git a/me.html b/me.html index 69a9912..00b37b7 100644 --- a/me.html +++ b/me.html @@ -465,7 +465,7 @@
- +