mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-07 23:55:07 +08:00
feat: add cache key
This commit is contained in:
@ -6,6 +6,16 @@ import WebStorageCache from 'web-storage-cache'
|
||||
|
||||
type CacheType = 'localStorage' | 'sessionStorage'
|
||||
|
||||
export const CACHE_KEY = {
|
||||
IS_DARK: 'isDark',
|
||||
USER: 'user',
|
||||
LANG: 'lang',
|
||||
THEME: 'theme',
|
||||
LAYOUT: 'layout',
|
||||
ROLE_ROUTERS: 'roleRouters',
|
||||
DICT_CACHE: 'dictCache'
|
||||
}
|
||||
|
||||
export const useCache = (type: CacheType = 'localStorage') => {
|
||||
const wsCache: WebStorageCache = new WebStorageCache({
|
||||
storage: type
|
||||
|
Reference in New Issue
Block a user