Initial commit

This commit is contained in:
lnljyang
2025-12-30 09:44:46 +08:00
commit 82b8d21506
147 changed files with 39113 additions and 0 deletions

32
utils/storage.js Normal file
View File

@@ -0,0 +1,32 @@
import JSONBigint from 'json-bigint';
export default {
get(key) {
if (!key) console.error('key不能为空');
let result = uni.getStorageSync(key);
try {
result = JSONBigint.parse(result);
} catch (e) {}
return result;
},
set(key, value) {
if (!key) console.error('key不能为空');
typeof value === 'object' && (value = JSONBigint.stringify(value));
try {
uni.setStorageSync(key, value)
} catch (e) {
console.log("数据存储错误", e)
}
},
remove(key) {
uni.removeStorageSync(key);
},
clean() {
uni.clearStorage();
}
};