mirror of
https://github.com/koel/koel
synced 2024-12-23 11:03:05 +00:00
35 lines
870 B
JavaScript
35 lines
870 B
JavaScript
|
import http from '../services/http';
|
||
|
|
||
|
export default {
|
||
|
state: {
|
||
|
songs: [],
|
||
|
albums: [],
|
||
|
artists: [],
|
||
|
favorites: [],
|
||
|
queued: [],
|
||
|
interactions: [],
|
||
|
users: [],
|
||
|
settings: [],
|
||
|
currentUser: null,
|
||
|
playlists: [],
|
||
|
},
|
||
|
|
||
|
init(cb = null) {
|
||
|
http.get('data', {}, data => {
|
||
|
this.state.songs = data.songs;
|
||
|
this.state.artists = data.artists;
|
||
|
this.state.albums = data.albums;
|
||
|
this.state.settings = data.settings;
|
||
|
this.state.playlists = data.playlists;
|
||
|
this.state.interactions = data.interactions;
|
||
|
this.state.users = data.users;
|
||
|
this.state.currentUser = data.user;
|
||
|
this.state.settings = data.settings;
|
||
|
|
||
|
if (cb) {
|
||
|
cb();
|
||
|
}
|
||
|
});
|
||
|
},
|
||
|
};
|