mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-20 22:51:23 +08:00
1. 在调用模块前,若req.query.cookie和req.body.cookie是字符串,则先解码,再转为对象。
2. 删除在各模块中的转换。 3. 更新文档。
This commit is contained in:
@@ -4,9 +4,6 @@
|
||||
// !需要登录或者匿名登录,非登录返回 []
|
||||
const config = require('../util/config.json')
|
||||
module.exports = (query, request) => {
|
||||
if (typeof query.cookie === 'string') {
|
||||
query.cookie = cookieToJson(query.cookie)
|
||||
}
|
||||
if (!('MUSIC_U' in query.cookie))
|
||||
query.cookie.MUSIC_A = config.anonymous_token
|
||||
const data = {}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
// 相似歌手
|
||||
const config = require('../util/config.json')
|
||||
module.exports = (query, request) => {
|
||||
if (typeof query.cookie === 'string') {
|
||||
query.cookie = cookieToJson(query.cookie)
|
||||
}
|
||||
if (!('MUSIC_U' in query.cookie))
|
||||
query.cookie.MUSIC_A = config.anonymous_token
|
||||
const data = {
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
// 歌曲链接
|
||||
|
||||
const crypto = require('crypto')
|
||||
const { cookieToJson } = require('../util/index')
|
||||
module.exports = (query, request) => {
|
||||
if (typeof query.cookie === 'string') {
|
||||
query.cookie = cookieToJson(query.cookie)
|
||||
}
|
||||
if (!('MUSIC_U' in query.cookie))
|
||||
query.cookie._ntes_nuid = crypto.randomBytes(16).toString('hex')
|
||||
query.cookie.os = 'pc'
|
||||
|
||||
Reference in New Issue
Block a user