From 0e658f9b5a4b42ed67f6d28be60e8b6336ae07ad Mon Sep 17 00:00:00 2001 From: binaryify Date: Sat, 4 Sep 2021 14:56:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B0=83=E7=94=A8=E4=B8=8D?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=E6=8E=A5=E5=8F=A3=E5=AF=BC=E8=87=B4?= =?UTF-8?q?API=E5=B4=A9=E6=BA=83=E7=9A=84=E9=97=AE=E9=A2=98=20#1345?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app.js b/app.js index 1f1fa0c..6ac5cf1 100644 --- a/app.js +++ b/app.js @@ -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)