refactor(config): 统一缓存键命名并优化主题设置逻辑
- 将缓存键名从带版本后缀的形式统一为无版本后缀 - 更新主题设置与读取逻辑,使用配置中心的缓存键定义 - 修正语言检测时对中文标识的判断逻辑 - 优化页面脚本加载顺序,确保配置文件优先加载 - 调整主题显示文本的中英文切换条件判断表达式
This commit is contained in:
@@ -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()
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user