mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-05-23 22:37:41 +08:00
fix: e_r在加密前插入data
This commit is contained in:
parent
83cc9a7566
commit
02505b72d4
@ -5,6 +5,7 @@ const createOption = (query, crypto = '') => {
|
|||||||
ua: query.ua || '',
|
ua: query.ua || '',
|
||||||
proxy: query.proxy,
|
proxy: query.proxy,
|
||||||
realIP: query.realIP,
|
realIP: query.realIP,
|
||||||
|
e_r: query.e_r || undefined,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
module.exports = createOption
|
module.exports = createOption
|
||||||
|
@ -143,9 +143,14 @@ const createRequest = (method, uri, data = {}, options) => {
|
|||||||
let eapi = () => {
|
let eapi = () => {
|
||||||
// 使用eapi加密
|
// 使用eapi加密
|
||||||
data.header = header
|
data.header = header
|
||||||
|
data.e_r =
|
||||||
|
options.e_r != undefined
|
||||||
|
? options.e_r
|
||||||
|
: data.e_r != undefined
|
||||||
|
? data.e_r
|
||||||
|
: APP_CONF.encryptResponse // 用于加密接口返回值
|
||||||
encryptData = encrypt.eapi(uri, data)
|
encryptData = encrypt.eapi(uri, data)
|
||||||
url = APP_CONF.apiDomain + '/eapi/' + uri.substr(5)
|
url = APP_CONF.apiDomain + '/eapi/' + uri.substr(5)
|
||||||
data.e_r = data.e_r != undefined ? data.e_r : APP_CONF.encryptResponse // 用于加密接口返回值
|
|
||||||
}
|
}
|
||||||
let api = () => {
|
let api = () => {
|
||||||
// 不使用任何加密
|
// 不使用任何加密
|
||||||
@ -232,7 +237,8 @@ const createRequest = (method, uri, data = {}, options) => {
|
|||||||
body.toString('hex').toUpperCase(),
|
body.toString('hex').toUpperCase(),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
answer.body = JSON.parse(body.toString())
|
answer.body =
|
||||||
|
typeof body == 'object' ? body : JSON.parse(body.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
if (answer.body.code) {
|
if (answer.body.code) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user