change router export mode

This commit is contained in:
Nzix
2018-09-30 20:45:10 +08:00
parent b03914bd1f
commit 08b5d5af27
104 changed files with 3430 additions and 1 deletions

43
module/user_update.js Normal file
View File

@ -0,0 +1,43 @@
// module.exports = (req, res, createWebAPIRequest, request) => {
// const cookie = req.get("Cookie") ? req.get("Cookie") : "";
// // 暂时不提供更换头像接口
// // gender为0表示保密1为男性2为女性
// const gender_type = req.query.gender;
// // birthday 为unix13位时间戳
// // province_number and city_number
// const data = {
// avatarImgId: "0",
// birthday: req.query.birthday,
// city: req.query.city,
// gender: gender_type,
// nickname: req.query.nickname,
// province: req.query.province,
// signature: req.query.signature,
// csrf_token: ""
// };
// createWebAPIRequest(
// "music.163.com",
// "/weapi/user/profile/update",
// "POST",
// data,
// cookie,
// music_req => res.send(music_req),
// err => res.status(502).send("fetch error")
// );
// };
module.exports = (query, request) => {
const data = {
avatarImgId: "0",
birthday: query.birthday,
city: query.city,
gender: query.gender,
nickname: query.nickname,
province: query.province,
signature: query.signature
}
return request(
'POST', `http://music.163.com/weapi/user/profile/update`, data,
{crypto: 'weapi', cookie: query.cookie, proxy: query.proxy}
)
}