first commit.

This commit is contained in:
2023-01-04 10:20:18 +08:00
commit 919fcf5ba9
39 changed files with 4196 additions and 0 deletions

21
src/utils/storage.ts Normal file
View File

@@ -0,0 +1,21 @@
const localStorage = window.localStorage;
export default {
set(key: string, value: any) {
localStorage.setItem(key, JSON.stringify(value));
},
get(key: string) {
const content = localStorage.getItem(key);
if (content) {
return JSON.parse(content);
} else {
return null;
}
},
remove(key: string) {
localStorage.removeItem(key);
},
clear() {
localStorage.clear();
},
};