/** * 永久化存储,存储在本地文件 */ export class AppStorageHelper { private constructor() { } /** * 缓存 * @param key * @param value */ public static save(key: string, value: T | undefined) { if (value === undefined || value === null) { PersistentStorage.deleteProp(key) } else { PersistentStorage.persistProp(key, value) } } /** * 删除缓存 * @param key * @param value */ public static delete(key: string) { PersistentStorage.deleteProp(key) } /** * 获取已缓存的内容 * @param key * @returns */ public static get(key: string): T | undefined { return AppStorage.get(key) } }