refactor(projects): new storage system [新的本地数据存储系统]

This commit is contained in:
Soybean
2022-11-17 01:47:06 +08:00
parent 7a58035514
commit 971915948b
23 changed files with 166 additions and 191 deletions

View File

@@ -1,6 +1,4 @@
export * from './typeof';
export * from './color';
export * from './number';
export * from './object';
export * from './pattern';
export * from './theme';

View File

@@ -1,4 +0,0 @@
/** 设置对象数据 */
export function objectAssign<T extends Record<string, any>>(target: T, source: Partial<T>) {
Object.assign(target, source);
}

View File

@@ -1,16 +0,0 @@
import { EnumStorageKey } from '@/enum';
/**
* 缓存主题颜色
* @param color
*/
export function setThemeColor(color: string) {
window.localStorage.setItem(EnumStorageKey['theme-color'], color);
}
/**
* 获取缓存的主题颜色
*/
export function getThemeColor() {
return window.localStorage.getItem(EnumStorageKey['theme-color']);
}