mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-05 12:48:54 +08:00
parent
ced768962a
commit
077a347d41
@ -1,4 +1,7 @@
|
|||||||
# 更新日志
|
# 更新日志
|
||||||
|
### 4.0.20 | 2021.8.20
|
||||||
|
- 手机登录增加验证码登录方式 [#1328](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1328)
|
||||||
|
|
||||||
### 4.0.19 | 2021.8.10
|
### 4.0.19 | 2021.8.10
|
||||||
- 修复若干问题
|
- 修复若干问题
|
||||||
|
|
||||||
|
@ -426,11 +426,13 @@ $ sudo docker run -d -p 3000:3000 netease-music-api
|
|||||||
**可选参数 :**
|
**可选参数 :**
|
||||||
`countrycode`: 国家码,用于国外手机号登录,例如美国传入:`1`
|
`countrycode`: 国家码,用于国外手机号登录,例如美国传入:`1`
|
||||||
|
|
||||||
`md5_password`: md5加密后的密码,传入后 `password` 将失效
|
`md5_password`: md5加密后的密码,传入后 `password` 参数将失效
|
||||||
|
|
||||||
|
`captcha`: 验证码,使用 [`/captcha/sent`](#发送验证码)接口传入手机号获取验证码,调用此接口传入验证码,可使用验证码登录,传入后 `password` 参数将失效
|
||||||
|
|
||||||
**接口地址 :** `/login/cellphone`
|
**接口地址 :** `/login/cellphone`
|
||||||
|
|
||||||
**调用例子 :** `/login/cellphone?phone=xxx&password=yyy` `/login/cellphone?phone=xxx&md5_password=yyy`
|
**调用例子 :** `/login/cellphone?phone=xxx&password=yyy` `/login/cellphone?phone=xxx&md5_password=yyy` `/login/cellphone?phone=xxx&captcha=1234`
|
||||||
|
|
||||||
#### 2. 邮箱登录
|
#### 2. 邮箱登录
|
||||||
|
|
||||||
|
8
interface.d.ts
vendored
8
interface.d.ts
vendored
@ -694,6 +694,14 @@ export function login_cellphone(
|
|||||||
} & RequestBaseConfig,
|
} & RequestBaseConfig,
|
||||||
): Promise<Response>
|
): Promise<Response>
|
||||||
|
|
||||||
|
export function login_cellphone(
|
||||||
|
params: {
|
||||||
|
phone: number | string
|
||||||
|
countrycode?: number | string
|
||||||
|
captcha: number | string
|
||||||
|
} & RequestBaseConfig,
|
||||||
|
): Promise<Response>
|
||||||
|
|
||||||
export function login_refresh(params: RequestBaseConfig): Promise<Response>
|
export function login_refresh(params: RequestBaseConfig): Promise<Response>
|
||||||
|
|
||||||
export function login_status(params: RequestBaseConfig): Promise<Response>
|
export function login_status(params: RequestBaseConfig): Promise<Response>
|
||||||
|
@ -7,9 +7,11 @@ module.exports = async (query, request) => {
|
|||||||
const data = {
|
const data = {
|
||||||
phone: query.phone,
|
phone: query.phone,
|
||||||
countrycode: query.countrycode || '86',
|
countrycode: query.countrycode || '86',
|
||||||
password:
|
captcha: query.captcha,
|
||||||
query.md5_password ||
|
[query.captcha ? 'captcha' : 'password']: query.captcha
|
||||||
crypto.createHash('md5').update(query.password).digest('hex'),
|
? query.captcha
|
||||||
|
: query.md5_password ||
|
||||||
|
crypto.createHash('md5').update(query.password).digest('hex'),
|
||||||
rememberLogin: 'true',
|
rememberLogin: 'true',
|
||||||
}
|
}
|
||||||
let result = await request(
|
let result = await request(
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "NeteaseCloudMusicApi",
|
"name": "NeteaseCloudMusicApi",
|
||||||
"version": "4.0.19",
|
"version": "4.0.20",
|
||||||
"description": "网易云音乐 NodeJS 版 API",
|
"description": "网易云音乐 NodeJS 版 API",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node app.js",
|
"start": "node app.js",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user