router done

This commit is contained in:
Jesse-Ma
2023-03-10 10:30:43 +08:00
parent fbb2c4064c
commit 11987b0a77
12 changed files with 21977 additions and 1054 deletions

View File

@@ -1,3 +1,5 @@
import localforage from "localforage";
class Storage {
constructor() {
this.session = new Session();
@@ -29,23 +31,23 @@ class Session {
class Local {
setObject(key, value) {
localStorage.setItem(key, JSON.stringify(value));
localforage.setItem(key, JSON.stringify(value));
}
getObject(key) {
return JSON.parse(localStorage.getItem(key));
return JSON.parse(localforage.getItem(key));
}
delete(key) {
localStorage.removeItem(key);
localforage.removeItem(key);
}
setText(key, value) {
localStorage.setItem(key, value);
localforage.setItem(key, value);
}
getText(key) {
return localStorage.getItem(key);
return localforage.getItem(key);
}
getUseSize() {