优化后台金山状态:登录后静默预取并在系统配置页复用缓存

This commit is contained in:
2026-02-16 01:42:47 +08:00
parent 1389ec7434
commit e725db79a9
25 changed files with 213 additions and 72 deletions
@@ -17,6 +17,7 @@ import {
import { api } from '../api/client'
import { fetchFeedbackStats } from '../api/feedbacks'
import { fetchSystemStats } from '../api/stats'
import { clearCachedKdocsStatus, preloadKdocsStatus } from '../utils/kdocsStatusCache'
const route = useRoute()
const router = useRouter()
@@ -102,6 +103,9 @@ onMounted(async () => {
mediaQuery.addEventListener?.('change', syncIsMobile)
syncIsMobile()
// 后台登录后预加载金山文档登录状态,系统配置页可直接复用缓存。
void preloadKdocsStatus({ maxAgeMs: 60_000, silent: true }).catch(() => {})
await refreshStats()
await refreshNavBadges()
scheduleBadgePolling()
@@ -160,6 +164,7 @@ async function logout() {
try {
await api.post('/logout')
} finally {
clearCachedKdocsStatus()
window.location.href = '/yuyx'
}
}