mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-05-23 22:37:41 +08:00
修复调用不存在的接口导致API崩溃的问题 #1345
This commit is contained in:
parent
28289beb8d
commit
0e658f9b5a
8
app.js
8
app.js
@ -117,6 +117,14 @@ fs.readdirSync(path.join(__dirname, 'module'))
|
|||||||
status: answer.status,
|
status: answer.status,
|
||||||
body: answer.body,
|
body: answer.body,
|
||||||
})
|
})
|
||||||
|
if (!answer.body) {
|
||||||
|
res.status(404).send({
|
||||||
|
code: 404,
|
||||||
|
data: null,
|
||||||
|
msg: 'Not Found',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
if (answer.body.code == '301') answer.body.msg = '需要登录'
|
if (answer.body.code == '301') answer.body.msg = '需要登录'
|
||||||
res.append('Set-Cookie', answer.cookie)
|
res.append('Set-Cookie', answer.cookie)
|
||||||
res.status(answer.status).send(answer.body)
|
res.status(answer.status).send(answer.body)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user