pull/96/head
lyswhut 2019-09-21 20:53:03 +08:00
parent 99b0595e50
commit ff09378c6d
1 changed files with 8 additions and 4 deletions

View File

@ -17,8 +17,11 @@ export default {
return searchRequest.promise.then(({ body }) => body) return searchRequest.promise.then(({ body }) => body)
}, },
handleResult(rawData) { handleResult(rawData) {
// console.log(rawData) let ids = new Set()
return rawData.map(item => { const list = []
rawData.forEach(item => {
if (ids.has(item.song_id)) return
ids.add(item.song_id)
const types = [] const types = []
const _types = {} const _types = {}
let size = null let size = null
@ -43,7 +46,7 @@ export default {
} }
// types.reverse() // types.reverse()
return { list.push({
singer: item.author.replace(',', '、'), singer: item.author.replace(',', '、'),
name: item.title, name: item.title,
albumName: item.album_title, albumName: item.album_title,
@ -56,8 +59,9 @@ export default {
types, types,
_types, _types,
typeUrl: {}, typeUrl: {},
}
}) })
})
return list
}, },
search(str, page = 1, { limit } = {}) { search(str, page = 1, { limit } = {}) {
if (limit != null) this.limit = limit if (limit != null) this.limit = limit