This commit is contained in:
18500206848
2024-02-02 14:44:30 +08:00
parent 6647042acb
commit 91172a730c
255 changed files with 24805 additions and 0 deletions

33
untils/store.js Normal file
View File

@@ -0,0 +1,33 @@
import website from '@/config/website'
const keyName = website.key + '-';
export const getStore = (params = {}) => {
let {
name,
debug
} = params;
name = keyName + name
const obj = uni.getStorageSync(name)
if (debug) {
return obj;
}
return obj.content
}
export const setStore = (params = {}) => {
let {
name,
content,
type,
} = params;
name = keyName + name
let obj = {
dataType: typeof(content),
content: content,
type: type,
datetime: new Date().getTime()
}
return uni.setStorageSync(name, obj)
}