From 61417032b79f99ecb462f7f7f2263c2d98d1b558 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期四, 20 四月 2023 18:45:29 +0800
Subject: [PATCH] fix 修复 代码生成菜单选项回显问题
---
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