提交 0e658f9b 编写于 作者: B binaryify

修复调用不存在的接口导致API崩溃的问题 #1345

上级 28289beb
......@@ -117,6 +117,14 @@ fs.readdirSync(path.join(__dirname, 'module'))
status: answer.status,
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 = '需要登录'
res.append('Set-Cookie', answer.cookie)
res.status(answer.status).send(answer.body)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册