Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #460 from KongValley/master
Browse files Browse the repository at this point in the history
添加手机注册相关接口
  • Loading branch information
Binaryify authored Apr 9, 2019
2 parents 07e1fc3 + b16db10 commit 68c54e6
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
17 changes: 17 additions & 0 deletions module/captch_register.js
Original file line number Diff line number Diff line change
@@ -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 changes: 14 additions & 0 deletions module/captch_sent.js
Original file line number Diff line number Diff line change
@@ -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 changes: 15 additions & 0 deletions module/captch_verify.js
Original file line number Diff line number Diff line change
@@ -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 }
)
}

0 comments on commit 68c54e6

Please sign in to comment.