合并人才集团代码

This commit is contained in:
2025-11-03 12:30:37 +08:00
parent 233e5fecdc
commit 1c6d5c7a15
118 changed files with 12562 additions and 14 deletions

44
utilsRc/storage.js Normal file
View File

@@ -0,0 +1,44 @@
/*
* @Descripttion:
* @Author: lip
* @Date: 2023-07-27 15:56:55
* @LastEditors: lip
*/
import constant from './constant'
// 存储变量名
let storageKey = 'storage_data'
// 存储节点变量名
let storageNodeKeys = [constant.avatar, constant.name, constant.roles, constant.permissions, constant.type, constant
.phonenumber,
constant.userId,
constant.handlerData,
constant.nick
]
// 存储的数据
let storageData = uni.getStorageSync(storageKey) || {}
const storage = {
set: function(key, value) {
if (storageNodeKeys.indexOf(key) != -1) {
let tmp = uni.getStorageSync(storageKey)
tmp = tmp ? tmp : {}
tmp[key] = value
uni.setStorageSync(storageKey, tmp)
}
},
get: function(key) {
return storageData[key] || ""
},
remove: function(key) {
delete storageData[key]
uni.setStorageSync(storageKey, storageData)
},
clean: function() {
uni.removeStorageSync(storageKey)
}
}
export default storage