This commit is contained in:
王鹏
2025-08-14 14:52:01 +08:00
commit 0c2edb6036
1551 changed files with 41152 additions and 0 deletions

28
utils/tool.js Normal file
View File

@@ -0,0 +1,28 @@
const tool = {}
/**
* localStorage
*/
tool.data = {
set(table, settings) {
const _set = JSON.stringify(settings)
return wx.setStorageSync(table, _set)
},
get(table) {
let data = wx.getStorageSync(table)
try {
data = JSON.parse(data)
} catch (err) {
return null
}
return data
},
remove() {
return wx.removeStorageSync(table)
},
clear() {
return wx.clearStorageSync()
}
}
export default tool