mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-23 16:11:24 +08:00
@@ -0,0 +1,32 @@
|
||||
const uploadPlugin = require('../plugins/upload')
|
||||
const createOption = require('../util/option.js')
|
||||
module.exports = async (query, request) => {
|
||||
if (!query.imgFile) {
|
||||
return {
|
||||
status: 400,
|
||||
body: {
|
||||
code: 400,
|
||||
msg: 'imgFile is required',
|
||||
},
|
||||
}
|
||||
}
|
||||
const uploadInfo = await uploadPlugin(query, request)
|
||||
const res = await request(
|
||||
`/api/playlist/cover/update`,
|
||||
{
|
||||
id: query.id,
|
||||
coverImgId: uploadInfo.imgId,
|
||||
},
|
||||
createOption(query, 'weapi'),
|
||||
)
|
||||
return {
|
||||
status: 200,
|
||||
body: {
|
||||
code: 200,
|
||||
data: {
|
||||
...uploadInfo,
|
||||
...res.body,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user