Skip to content

Commit c87de77

Browse files
committed
fix: 修复 notfound 逻辑
1 parent aaea9e8 commit c87de77

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/plugins/factory/Lifecycle.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ module.exports = class Lifecycle {
4242
app.use(async (ctx, next) => {
4343
await next();
4444
if (ctx.status === config.STATUS_CODES.StatusNotFound) {
45-
ctx.result(config.STATUS_CODES.StatusNotFound, 'Not Found API');
46-
} else if (!ctx.body) {
47-
ctx.result(config.STATUS_CODES.StatusNotFound, 'Not Found');
45+
if (!ctx.body) {
46+
ctx.result(config.STATUS_CODES.StatusNotFound, 'Not Found API');
47+
}
4848
}
4949
});
5050
}

0 commit comments

Comments
 (0)