Files
filecodebox/src/utils/preference-storage 2.ts
T
orion 8badb80600 ✨ feat(core): 实现管理端后台界面及核心功能模块
* 初始化后台管理布局与路由框架
* 新增文件管理、仪表盘、系统设置及日志视图
* 实现文件上传预签名、提取流程及发送记录管理
* 构建常用组件库如模态框、表格、分页及进度条
* 引入多语言支持(中英文)及主题切换功能
* 封装后台业务逻辑 Hooks 和数据持久化存储功能
2026-09-11 16:51:50 +08:00

21 lines
558 B
TypeScript

import { STORAGE_KEYS } from '@/constants'
import type { ThemeMode } from '@/types'
const LOCALE_STORAGE_KEY = 'locale'
export function readStoredThemeMode(): string | null {
return localStorage.getItem(STORAGE_KEYS.COLOR_MODE)
}
export function writeStoredThemeMode(mode: ThemeMode) {
localStorage.setItem(STORAGE_KEYS.COLOR_MODE, mode)
}
export function readStoredLocale(): string | null {
return localStorage.getItem(LOCALE_STORAGE_KEY)
}
export function writeStoredLocale(locale: string) {
localStorage.setItem(LOCALE_STORAGE_KEY, locale)
}