feat(index): 添加页面加载超时提示,修改默认主题设置为跟随系统

fix(service-worker): 优化清理运行时缓存逻辑
This commit is contained in:
PKC278
2026-01-02 21:22:27 +08:00
parent 425bf808ed
commit 78e2d05730
6 changed files with 96 additions and 19 deletions

View File

@@ -15,7 +15,7 @@ import { themeManager } from '@/utils/themeManager'
// 生效主题
const { global: globalTheme } = useTheme()
let themeValue = localStorage.getItem('theme') || 'light'
let themeValue = localStorage.getItem('theme') || 'auto'
const autoTheme = checkPrefersColorSchemeIsDark() ? 'dark' : 'light'
globalTheme.name.value = themeValue === 'auto' ? autoTheme : themeValue
@@ -239,8 +239,8 @@ async function loadBackgroundImages(retryCount = 0) {
onMounted(async () => {
// 移除URL中的时间戳参数
const url = new URL(window.location.href)
if (url.searchParams.has('t')) {
url.searchParams.delete('t')
if (url.searchParams.has('_t')) {
url.searchParams.delete('_t')
window.history.replaceState({}, '', url.toString())
}