From 1595cb282aab5399862fac6406b5de550863e3b6 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期一, 03 四月 2023 00:05:09 +0800 Subject: [PATCH] update 调整代码格式 --- src/plugins/cache.ts | 140 +++++++++++++++++++++++----------------------- 1 files changed, 70 insertions(+), 70 deletions(-) diff --git a/src/plugins/cache.ts b/src/plugins/cache.ts index c3cc7eb..cf43680 100644 --- a/src/plugins/cache.ts +++ b/src/plugins/cache.ts @@ -1,77 +1,77 @@ const sessionCache = { - set(key: string, value: any) { - if (!sessionStorage) { - return; - } - if (key != null && value != null) { - sessionStorage.setItem(key, value); - } - }, - get(key: string) { - if (!sessionStorage) { - return null; - } - if (key == null) { - return null; - } - return sessionStorage.getItem(key); - }, - setJSON(key: string, jsonValue: any) { - if (jsonValue != null) { - this.set(key, JSON.stringify(jsonValue)); - } - }, - getJSON(key: string) { - const value = this.get(key); - if (value != null) { - return JSON.parse(value); - } - }, - remove(key: string) { - sessionStorage.removeItem(key); - } + set(key: string, value: any) { + if (!sessionStorage) { + return; + } + if (key != null && value != null) { + sessionStorage.setItem(key, value); + } + }, + get(key: string) { + if (!sessionStorage) { + return null; + } + if (key == null) { + return null; + } + return sessionStorage.getItem(key); + }, + setJSON(key: string, jsonValue: any) { + if (jsonValue != null) { + this.set(key, JSON.stringify(jsonValue)); + } + }, + getJSON(key: string) { + const value = this.get(key); + if (value != null) { + return JSON.parse(value); + } + }, + remove(key: string) { + sessionStorage.removeItem(key); + } }; const localCache = { - set(key: string, value: any) { - if (!localStorage) { - return; - } - if (key != null && value != null) { - localStorage.setItem(key, value); - } - }, - get(key: string) { - if (!localStorage) { - return null; - } - if (key == null) { - return null; - } - return localStorage.getItem(key); - }, - setJSON(key: string, jsonValue: any) { - if (jsonValue != null) { - this.set(key, JSON.stringify(jsonValue)); - } - }, - getJSON(key: string) { - const value = this.get(key); - if (value != null) { - return JSON.parse(value); - } - }, - remove(key: string) { - localStorage.removeItem(key); - } + set(key: string, value: any) { + if (!localStorage) { + return; + } + if (key != null && value != null) { + localStorage.setItem(key, value); + } + }, + get(key: string) { + if (!localStorage) { + return null; + } + if (key == null) { + return null; + } + return localStorage.getItem(key); + }, + setJSON(key: string, jsonValue: any) { + if (jsonValue != null) { + this.set(key, JSON.stringify(jsonValue)); + } + }, + getJSON(key: string) { + const value = this.get(key); + if (value != null) { + return JSON.parse(value); + } + }, + remove(key: string) { + localStorage.removeItem(key); + } }; export default { - /** - * 浼氳瘽绾х紦瀛� - */ - session: sessionCache, - /** - * 鏈湴缂撳瓨 - */ - local: localCache + /** + * 浼氳瘽绾х紦瀛� + */ + session: sessionCache, + /** + * 鏈湴缂撳瓨 + */ + local: localCache }; -- Gitblit v1.9.3