提交 80961900 编写于 作者: B binaryify

修复新版评论返回参数错误问题 #1393

上级 9f0ea1da
# 更新日志
### 4.1.0 | 2021.11.20
- 修复新版评论返回参数错误问题 [#1393](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1393) [#1377](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1377)
- 新增获取歌单所有歌曲的 API [#1397](https://github.com/Binaryify/NeteaseCloudMusicApi/pull/1397)
- 新增发送文本动态接口, 获取客户端歌曲下载链接 url 接口 [#1391](https://github.com/Binaryify/NeteaseCloudMusicApi/pull/1391)
### 4.0.23 | 2021.9.15
- 修复文件上传设置问题 [#1355](https://github.com/Binaryify/NeteaseCloudMusicApi/pull/1355)
- 修复interface不完整问题 [#1356](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1356)
- 修复 interface 不完整问题 [#1356](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1356)
### 4.0.22 | 2021.9.08
......
......@@ -1748,7 +1748,7 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具
`pageSize`:分页参数,每页多少条数据,默认20
`sortType`: 排序方式,1:按推荐排序,2:按热度排序,3:按时间排序
`sortType`: 排序方式, 1:按推荐排序, 2:按热度排序, 3:按时间排序
`cursor`: 当`sortType`为3时且页数不是第一页时需传入,值为上一条数据的time
......@@ -1765,7 +1765,7 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具
`cid` : 评论 id
`t` : 是否点赞 ,1 为点赞 ,0 为取消点赞
`t` : 是否点赞 , 1 为点赞 ,0 为取消点赞
`type`: 数字 , 资源类型 , 对应歌曲 , mv, 专辑 , 歌单 , 电台, 视频对应以下类型
......
......@@ -1534,3 +1534,23 @@ export function musician_cloudbean_obtain(
export function vip_info(params: RequestBaseConfig): Promise<Response>
export function musician_sign(params: RequestBaseConfig): Promise<Response>
export function song_download_url(
params: {
id: number | string
br?: number | string
} & RequestBaseConfig,
): Promise<Response>
export function send_event_text(
params: {
msg: number | string
} & RequestBaseConfig,
): Promise<Response>
export function playlist_track_all(
params: {
id: number | string
s?: number | string
} & RequestBaseConfig,
): Promise<Response>
......@@ -7,14 +7,31 @@ module.exports = (query, request) => {
const threadId = query.type + query.id
const pageSize = query.pageSize || 20
const pageNo = query.pageNo || 1
let sortType = Number(query.sortType) || 99
if (sortType === 1) {
sortType = 99
}
let cursor = ''
switch (sortType) {
case 99:
cursor = (pageNo - 1) * pageSize
break
case 2:
cursor = 'normalHot#' + (pageNo - 1) * pageSize
break
case 3:
cursor = query.cursor || '0'
break
default:
break
}
const data = {
threadId: threadId,
pageNo,
showInner: query.showInner || true,
pageSize,
cursor:
+query.sortType === 3 ? query.cursor || '0' : (pageNo - 1) * pageSize,
sortType: query.sortType || 1, //1:按推荐排序,2:按热度排序,3:按时间排序
cursor: cursor,
sortType: sortType, //99:按推荐排序,2:按热度排序,3:按时间排序
}
return request(
'POST',
......
{
"name": "NeteaseCloudMusicApi",
"version": "4.0.23",
"version": "4.1.0",
"description": "网易云音乐 NodeJS 版 API",
"scripts": {
"start": "node app.js",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册