refactor(chat-ui): 抽离侧边栏并统一账号/实时/隐私状态

新增 SidebarRail 组件并统一主导航入口

引入 chatAccounts/chatRealtime/privacy 三个 Pinia store 复用全局状态

聊天/联系人/朋友圈页面去重侧栏逻辑,app 根布局统一承载标题栏与内容区
This commit is contained in:
2977094657
2026-02-11 12:14:21 +08:00
parent 7447a904b3
commit 2ce479aefd
10 changed files with 728 additions and 852 deletions

View File

@@ -0,0 +1,20 @@
export const PRIVACY_MODE_KEY = 'ui.privacy_mode'
export const readPrivacyMode = (fallback = false) => {
if (!process.client) return !!fallback
try {
const raw = localStorage.getItem(PRIVACY_MODE_KEY)
if (raw == null) return !!fallback
const normalized = String(raw).trim().toLowerCase()
return normalized === '1' || normalized === 'true'
} catch {
return !!fallback
}
}
export const writePrivacyMode = (enabled) => {
if (!process.client) return
try {
localStorage.setItem(PRIVACY_MODE_KEY, enabled ? '1' : '0')
} catch {}
}