wip(Login): Login developing

This commit is contained in:
陈凯龙
2022-01-05 17:02:25 +08:00
parent 77097c8d92
commit 4216f7c218
26 changed files with 391 additions and 1597 deletions

17
src/hooks/web/useCache.ts Normal file
View File

@@ -0,0 +1,17 @@
/**
* 配置浏览器本地存储的方式,可直接存储对象数组。
*/
import WebStorageCache from 'web-storage-cache'
type CacheType = 'sessionStorage' | 'localStorage'
export function useCache(type: CacheType = 'sessionStorage') {
const wsCache: WebStorageCache = new WebStorageCache({
storage: type
})
return {
wsCache
}
}