From a26e8d708ab3c8899bee5cae4167ccc3be9b58cd Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期三, 03 九月 2025 14:00:23 +0800 Subject: [PATCH] 销售管理整体样式优化,搜索条件修改 --- src/utils/storage.ts | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/src/utils/storage.ts b/src/utils/storage.ts new file mode 100644 index 0000000..3454568 --- /dev/null +++ b/src/utils/storage.ts @@ -0,0 +1,33 @@ +import constant from './constant' + +// 瀛樺偍鍙橀噺鍚� +let storageKey = 'storage_data' + +// 瀛樺偍鑺傜偣鍙橀噺鍚� +let storageNodeKeys = [constant.avatar, constant.name, constant.roles, constant.permissions] + +// 瀛樺偍鐨勬暟鎹� +let storageData = uni.getStorageSync(storageKey) || {} + +const storage = { + set: function(key:string, value:any) { + if (storageNodeKeys.indexOf(key) != -1) { + let tmp = uni.getStorageSync(storageKey) + tmp = tmp ? tmp : {} + tmp[key] = value + uni.setStorageSync(storageKey, tmp) + } + }, + get: function(key:string) { + return storageData[key] || "" + }, + remove: function(key:string) { + delete storageData[key] + uni.setStorageSync(storageKey, storageData) + }, + clean: function() { + uni.removeStorageSync(storageKey) + } +} + +export default storage -- Gitblit v1.9.3