From 542dcd62fa061525a00339011ff24246f03b820e Mon Sep 17 00:00:00 2001 From: wjli <591616088@qq.com> Date: 星期二, 09 四月 2024 08:36:49 +0800 Subject: [PATCH] 添加签收查询 --- src/libs/storage.js | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/src/libs/storage.js b/src/libs/storage.js index 4602cab..ec51907 100644 --- a/src/libs/storage.js +++ b/src/libs/storage.js @@ -8,6 +8,14 @@ } window.localStorage.setItem(name, content); } +export const setSessionStore = (name, content) => { + if (!name) return; + if (typeof content !== 'string') { + content = JSON.stringify(content); + } + window.sessionStorage.setItem(name, content); +} + /** * 鑾峰彇localStorage @@ -21,6 +29,16 @@ return v; } +export const getSessionStore = name => { + if (!name) return; + let v = window.sessionStorage.getItem(name); + if (v == null) { + return ""; + } + return v; +} + + /** * 鍒犻櫎localStorage */ -- Gitblit v1.9.1