This commit is contained in:
An Phan 2016-12-21 00:02:58 +08:00
parent 9dc0ddebb5
commit 600e937e4e
No known key found for this signature in database
GPG key ID: 05536BB4BCDC02A2
5 changed files with 5 additions and 7 deletions

View file

@ -1,4 +1,3 @@
import { $ } from '../utils'
import { queueStore, playlistStore, favoriteStore } from '../stores'
/**

View file

@ -1,8 +1,7 @@
import { map, reduce } from 'lodash'
import { reduce } from 'lodash'
import { playlistStore, favoriteStore } from '../stores'
import { ls } from '.'
import { $ } from '../utils'
export const download = {
/**
@ -12,7 +11,7 @@ export const download = {
*/
fromSongs (songs) {
songs = [].concat(songs)
const query = reduce(songs, (q, song) => `songs[]=${song.id}&${segment}`, '')
const query = reduce(songs, (q, song) => `songs[]=${song.id}&${q}`, '')
return this.trigger(`songs?${query}`)
},

View file

@ -216,7 +216,7 @@ export const songStore = {
scrobble (song) {
return new Promise((resolve, reject) => {
http.post(`${song.id}/scrobble/${song.playStartTime}`, {}, response => {
resolve(data.response)
resolve(response.data)
}, error => reject(error))
})
},

View file

@ -197,7 +197,7 @@ export const userStore = {
NProgress.start()
return new Promise((resolve, reject) => {
http.delete(`user/${user.id}`, {}, () => {
http.delete(`user/${user.id}`, {}, response => {
this.all = without(this.all, user)
alerts.success(`User "${user.name}" deleted.`)

View file

@ -43,7 +43,7 @@ export const $ = {
if (el.scrollTop === to) {
return
}
this.scrollTo(el, to, duration - 10);
this.scrollTo(el, to, duration - 10)
}, 10)
}
}