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

This commit is contained in:
binaryify 2021-11-20 17:20:50 +08:00
parent 9f0ea1dabc
commit 80961900f9
5 changed files with 53 additions and 7 deletions

View File

@ -1,5 +1,14 @@
# 更新日志 # 更新日志
### 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 ### 4.0.23 | 2021.9.15
- 修复文件上传设置问题 [#1355](https://github.com/Binaryify/NeteaseCloudMusicApi/pull/1355) - 修复文件上传设置问题 [#1355](https://github.com/Binaryify/NeteaseCloudMusicApi/pull/1355)

20
interface.d.ts vendored
View File

@ -1534,3 +1534,23 @@ export function musician_cloudbean_obtain(
export function vip_info(params: RequestBaseConfig): Promise<Response> export function vip_info(params: RequestBaseConfig): Promise<Response>
export function musician_sign(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>

View File

@ -7,14 +7,31 @@ module.exports = (query, request) => {
const threadId = query.type + query.id const threadId = query.type + query.id
const pageSize = query.pageSize || 20 const pageSize = query.pageSize || 20
const pageNo = query.pageNo || 1 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 = { const data = {
threadId: threadId, threadId: threadId,
pageNo, pageNo,
showInner: query.showInner || true, showInner: query.showInner || true,
pageSize, pageSize,
cursor: cursor: cursor,
+query.sortType === 3 ? query.cursor || '0' : (pageNo - 1) * pageSize, sortType: sortType, //99:按推荐排序,2:按热度排序,3:按时间排序
sortType: query.sortType || 1, //1:按推荐排序,2:按热度排序,3:按时间排序
} }
return request( return request(
'POST', 'POST',

View File

@ -1,6 +1,6 @@
{ {
"name": "NeteaseCloudMusicApi", "name": "NeteaseCloudMusicApi",
"version": "4.0.23", "version": "4.1.0",
"description": "网易云音乐 NodeJS 版 API", "description": "网易云音乐 NodeJS 版 API",
"scripts": { "scripts": {
"start": "node app.js", "start": "node app.js",