Merge pull request #460 from KongValley/master

添加手机注册相关接口
This commit is contained in:
阿发 2019-04-09 16:14:36 +08:00 committed by GitHub
commit 6a407a2df8
3 changed files with 46 additions and 0 deletions

17
module/captch_register.js Normal file
View File

@ -0,0 +1,17 @@
// 注册账号
const crypto = require('crypto')
module.exports = (query, request) => {
const data = {
captcha: query.captcha,
phone: query.phone,
password: crypto.createHash('md5').update(query.password).digest('hex'),
nickname: query.nickname
}
return request(
'POST',
`https://music.163.com/weapi/register/cellphone`,
data,
{ crypto: 'weapi', cookie: query.cookie, proxy: query.proxy }
)
}

14
module/captch_sent.js Normal file
View File

@ -0,0 +1,14 @@
// 发送验证码
module.exports = (query, request) => {
const data = {
ctcode: '86',
cellphone: query.cellphone,
}
return request(
'POST',
`https://music.163.com/weapi/sms/captcha/sent`,
data,
{ crypto: 'weapi', cookie: query.cookie, proxy: query.proxy }
)
}

15
module/captch_verify.js Normal file
View File

@ -0,0 +1,15 @@
// 校验验证码
module.exports = (query, request) => {
const data = {
ctcode: '86',
cellphone: query.cellphone,
captcha: query.captcha
}
return request(
'POST',
`https://music.163.com/weapi/sms/captcha/verify`,
data,
{ crypto: 'weapi', cookie: query.cookie, proxy: query.proxy }
)
}