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

pull/1583/head
lyswhut 2023-09-02 13:33:44 +08:00
parent 2fff8652ca
commit ed858bafdc
2 changed files with 4 additions and 2 deletions

View File

@ -29,6 +29,7 @@
- 修复windows平台下隐藏窗口后再显示时任务栏按钮丢失的问题 - 修复windows平台下隐藏窗口后再显示时任务栏按钮丢失的问题
- 修复首句歌词被提前播放的问题 - 修复首句歌词被提前播放的问题
- 修复潜在导致列表数据不同步的问题 - 修复潜在导致列表数据不同步的问题
- 修复kg无评论时的加载处理问题
### 其他 ### 其他

View File

@ -18,7 +18,8 @@ export default {
const { body, statusCode } = await _requestObj.promise const { body, statusCode } = await _requestObj.promise
// console.log(body) // console.log(body)
if (statusCode != 200 || body.err_code !== 0) throw new Error('获取评论失败') 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) { async getHotComment({ hash }, page = 1, limit = 20) {
// console.log(songmid) // console.log(songmid)
@ -34,7 +35,7 @@ export default {
// console.log(body) // console.log(body)
if (statusCode != 200 || body.err_code !== 0) throw new Error('获取热门评论失败') if (statusCode != 200 || body.err_code !== 0) throw new Error('获取热门评论失败')
const total = body.count ?? 0 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) { async getReplyComment({ songmid, audioId }, replyId, page = 1, limit = 100) {
if (this._requestObj2) this._requestObj2.cancelHttp() if (this._requestObj2) this._requestObj2.cancelHttp()