From 247eae081ce7c325798c6a26a6823c5feec6fc86 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周日, 04 5月 2025 17:18:43 +0800
Subject: [PATCH] 222
---
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