Skip to content

Commit 8504664

Browse files
committed
feat: 当禁用响应时,不再返回
1 parent b7a2751 commit 8504664

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/plugins/factory/Lifecycle.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ module.exports = class Lifecycle {
4141
// 404 Not Found
4242
app.use(async (ctx, next) => {
4343
await next();
44+
if (ctx.respond === false) return; // 禁用响应
4445
if (ctx.status === config.STATUS_CODES.StatusNotFound) {
4546
if (!ctx.body) {
4647
ctx.result(config.STATUS_CODES.StatusNotFound, 'Not Found API');

0 commit comments

Comments
 (0)