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

添加手机注册相关接口 #460

Merged
merged 2 commits into from
Apr 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }
)
}