1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-11 20:01:10 +00:00

feat: sf metadata display (#6249)

* feat: sf metadata display

* feat: update code

* feat: update code

* feat: lock react version

* feat: bug

* feat: optimize code

* feat: update transalte

* feat: update transalte

* feat: rebase code

* Feat: update code

* Feat: update code

---------

Co-authored-by: 杨国璇 <ygx@192.168.1.5>
Co-authored-by: 杨国璇 <ygx@Hello-word.local>
Co-authored-by: 杨国璇 <ygx@192.168.1.13>
This commit is contained in:
杨国璇
2024-06-29 17:58:27 +08:00
committed by GitHub
parent 4f888be82c
commit 19f15c944f
207 changed files with 18330 additions and 348 deletions

View File

@@ -0,0 +1,28 @@
class LocalStorage {
constructor(baseName) {
this.baseName = baseName || 'sf-metadata';
}
getStorage() {
try {
return JSON.parse(window.localStorage.getItem(this.baseName) || '{}');
} catch (error) {
return '';
}
}
setItem(key, value) {
const storage = this.getStorage();
const newValue = { ...storage, [key]: value };
return window.localStorage.setItem(this.baseName, JSON.stringify(newValue));
}
getItem(key) {
const storage = this.getStorage();
return storage[key];
}
}
export default LocalStorage;