From 1473745cf39e94933179276a6d533bff2ceff79d Mon Sep 17 00:00:00 2001
From: zs <zhousong@weben-smart.com>
Date: 周二, 06 5月 2025 16:22:55 +0800
Subject: [PATCH] 任务管理
---
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