mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-07 03:32:07 +08:00
1. 在调用模块前,若req.query.cookie
和req.body.cookie
是字符串,则先解码,再转为对象。
2. 删除在各模块中的转换。 3. 更新文档。
This commit is contained in:
8
app.js
8
app.js
@ -78,9 +78,11 @@ fs.readdirSync(path.join(__dirname, 'module'))
|
||||
let question = require(path.join(__dirname, 'module', file))
|
||||
|
||||
app.use(route, (req, res) => {
|
||||
if (typeof req.query.cookie === 'string') {
|
||||
req.query.cookie = cookieToJson(req.query.cookie)
|
||||
}
|
||||
;[req.query, req.body].forEach((item) => {
|
||||
if (typeof item.cookie === 'string') {
|
||||
item.cookie = cookieToJson(decodeURIComponent(item.cookie))
|
||||
}
|
||||
})
|
||||
let query = Object.assign(
|
||||
{},
|
||||
{ cookie: req.cookies },
|
||||
|
Reference in New Issue
Block a user