From 06c2653afafc14fac832ba7ba39624b040d39ec5 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周三, 07 5月 2025 11:13:18 +0800
Subject: [PATCH] //去重操作 columnList = columnList.GroupBy(p => p.ColumnName).Select(g => g.First()).ToList();
---
PipeLineLems/web/src/utils/storage.ts | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/PipeLineLems/web/src/utils/storage.ts b/PipeLineLems/web/src/utils/storage.ts
index c626ed4..240a5dd 100644
--- a/PipeLineLems/web/src/utils/storage.ts
+++ b/PipeLineLems/web/src/utils/storage.ts
@@ -41,8 +41,13 @@
// 鑾峰彇涓存椂缂撳瓨
get(key: string) {
const value: null | string = window.sessionStorage.getItem(key)
- if (!value) return null
- return JSON.parse(value)
+
+ try {
+ if (!value) return null
+ return JSON.parse(value)
+ } catch (error) {
+ return value
+ }
},
// 绉婚櫎涓存椂缂撳瓨
remove(key: string) {
@@ -54,7 +59,4 @@
},
}
-export {
- Local,
- Session
-}
\ No newline at end of file
+export { Local, Session }
--
Gitblit v1.9.3