From 3cd9f003ae893abe2483ab3ce0a62bfbd9fa8554 Mon Sep 17 00:00:00 2001 From: zs <zhousong@weben-smart.com> Date: 周一, 05 5月 2025 18:04:15 +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