修复kg无评论时的加载处理问题

This commit is contained in:
lyswhut 2023-09-02 13:32:19 +08:00
parent 9b21155acf
commit a3d6272896
2 changed files with 4 additions and 2 deletions

View File

@ -35,6 +35,7 @@
- 修复mg歌单搜索歌单播放数量显示问题
- 修复搜索提示功能失效的问题(@Folltoshe
- 修复潜在导致列表数据不同步的问题
- 修复kg无评论时的加载处理问题
### 其他

View File

@ -19,7 +19,8 @@ export default {
const { body, statusCode } = await _requestObj.promise
// console.log(body)
if (statusCode != 200 || body.err_code !== 0) throw new Error('获取评论失败')
return { source: 'kg', comments: this.filterComment(body.list || []), total: body.count, page, limit, maxPage: body.maxPage }
const total = body.count ?? 0
return { source: 'kg', comments: this.filterComment(body.list || []), total, page, limit, maxPage: Math.ceil(total / limit) || 1 }
},
async getHotComment({ hash }, page = 1, limit = 20) {
// console.log(songmid)
@ -36,7 +37,7 @@ export default {
// console.log(body)
if (statusCode != 200 || body.err_code !== 0) throw new Error('获取热门评论失败')
const total = body.count ?? 0
return { source: 'kg', comments: this.filterComment(body.list || []), total, page, limit, maxPage: Math.ceil(body.count / limit) || 1 }
return { source: 'kg', comments: this.filterComment(body.list || []), total, page, limit, maxPage: Math.ceil(total / limit) || 1 }
},
async getReplyComment({ songmid, audioId }, replyId, page = 1, limit = 100) {
if (this._requestObj2) this._requestObj2.cancelHttp()