初始化项目,自 v1.7.1 版本开始

This commit is contained in:
YunaiV committed 2023-02-11 00:44:00 +08:00
1 parent 11161afc1a
commit 56f3017baa
548 files changed
+52096 -61

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
/**
* 配置浏览器本地存储的方式,可直接存储对象数组。
*/
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
})
return {
wsCache
}
}