新增更新头像,歌单封面上传接口和相关例子 #403 #857

This commit is contained in:
binaryify
2020-08-03 23:09:36 +08:00
parent 0ad746dad4
commit 8df5d7a790
11 changed files with 356 additions and 52 deletions

22
module/avatar_upload.js Normal file
View File

@ -0,0 +1,22 @@
const uploadPlugin = require('../plugins/upload')
module.exports = async (query, request) => {
const uploadInfo = await uploadPlugin(query, request)
const res = await request(
'POST',
`https://music.163.com/weapi/user/avatar/upload/v1`,
{
imgid: uploadInfo.imgId
},
{ crypto: 'weapi', cookie: query.cookie, proxy: query.proxy }
)
return {
status: 200,
body: {
code: 200,
data: {
...uploadInfo,
...res.body,
},
},
}
}