mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-20 22:51:23 +08:00
refactor: request无需传入请求方式
This commit is contained in:
@@ -12,28 +12,24 @@ module.exports = (query, request) => {
|
||||
let limit = parseInt(query.limit) || Infinity
|
||||
let offset = parseInt(query.offset) || 0
|
||||
|
||||
return request(
|
||||
'POST',
|
||||
`/api/v6/playlist/detail`,
|
||||
data,
|
||||
createOption(query),
|
||||
).then((res) => {
|
||||
let trackIds = res.body.playlist.trackIds
|
||||
let idsData = {
|
||||
c:
|
||||
'[' +
|
||||
trackIds
|
||||
.slice(offset, offset + limit)
|
||||
.map((item) => '{"id":' + item.id + '}')
|
||||
.join(',') +
|
||||
']',
|
||||
}
|
||||
return request(`/api/v6/playlist/detail`, data, createOption(query)).then(
|
||||
(res) => {
|
||||
let trackIds = res.body.playlist.trackIds
|
||||
let idsData = {
|
||||
c:
|
||||
'[' +
|
||||
trackIds
|
||||
.slice(offset, offset + limit)
|
||||
.map((item) => '{"id":' + item.id + '}')
|
||||
.join(',') +
|
||||
']',
|
||||
}
|
||||
|
||||
return request(
|
||||
'POST',
|
||||
`/api/v3/song/detail`,
|
||||
idsData,
|
||||
createOption(query, 'weapi'),
|
||||
)
|
||||
})
|
||||
return request(
|
||||
`/api/v3/song/detail`,
|
||||
idsData,
|
||||
createOption(query, 'weapi'),
|
||||
)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user