mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 02:01:20 -08:00
白名单暴露更多信息
This commit is contained in:
1 parent
8653940a76
commit
3c0ea56c11
5 files changed
+53
-54
No files matched your search
@@ -5,10 +5,18 @@ export default class Storage {
|
||||
this.art = art;
|
||||
this.storageName = 'artplayer_settings';
|
||||
sleep().then(() => {
|
||||
this.initVolume();
|
||||
this.init();
|
||||
});
|
||||
}
|
||||
|
||||
init() {
|
||||
const { player } = this.art;
|
||||
const volume = this.get('volume');
|
||||
if (volume) {
|
||||
player.volume = volume;
|
||||
}
|
||||
}
|
||||
|
||||
get(key) {
|
||||
const storage = JSON.parse(localStorage.getItem(this.storageName)) || {};
|
||||
return key ? storage[key] : {};
|
||||
@@ -20,12 +28,4 @@ export default class Storage {
|
||||
});
|
||||
localStorage.setItem(this.storageName, JSON.stringify(storage));
|
||||
}
|
||||
|
||||
initVolume() {
|
||||
const { player } = this.art;
|
||||
const volume = this.get('volume');
|
||||
if (volume) {
|
||||
player.volume = volume;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user