修复聚合搜索的分页问题

This commit is contained in:
lyswhut
2020-10-02 12:59:41 +08:00
parent 1fa015704a
commit c40dc0fa50
2 changed files with 3 additions and 25 deletions
+2 -3
View File
@@ -84,12 +84,11 @@ export default {
if (limit != null) this.limit = limit
return this.musicSearch(str, page).then(result => {
if (!result || result.code !== 200) return this.search(str, page, { limit }, retryNum)
// console.log(result.result)
let list = this.handleResult(result.result.songs)
let list = this.handleResult(result.result.songs || [])
if (list == null) return this.search(str, page, { limit }, retryNum)
this.total = result.result.songCount
this.total = result.result.songCount || 0
this.page = page
this.allPage = Math.ceil(this.total / this.limit)