完善评论功能

This commit is contained in:
lyswhut
2020-10-29 09:07:25 +08:00
parent dec1b24c86
commit 93064bb18b
4 changed files with 13 additions and 7 deletions
+2 -1
View File
@@ -14,7 +14,7 @@ export default {
})
const { body, statusCode } = await _requestObj.promise
if (statusCode != 200 || body.result !== 'ok') throw new Error('获取评论失败')
console.log(body)
// console.log(body)
return { source: 'kw', comments: this.filterComment(body.rows), total: body.total, page, limit, maxPage: Math.ceil(body.total / limit) || 1 }
},
async getHotComment({ songmid }, page = 1, limit = 100) {
@@ -31,6 +31,7 @@ export default {
return { source: 'kw', comments: this.filterComment(body.rows) }
},
filterComment(rawList) {
if (!rawList) return []
return rawList.map(item => {
let data = {
id: item.id,