增加阻止路由往下走的逻辑

v1
yutent 2022-12-09 10:40:31 +08:00
parent 2ab7355a2e
commit a135007f35
2 changed files with 6 additions and 3 deletions

View File

@ -31,7 +31,10 @@ export default function (req, res, next) {
// 4. 优先执行__main__方法
if (app.__main__) {
try {
await app.__main__()
let r = await app.__main__()
if (r === false) {
return
}
} catch (err) {
return Promise.reject(err)
}

View File

@ -1,6 +1,6 @@
{
"name": "@gm5/core",
"version": "1.1.1",
"version": "1.1.2",
"type": "module",
"description": "Five.js, 一个轻量级的nodejs mvc框架 旨在简单易用, 5分钟即可上手",
"author": "yutent <yutent.io@gmail.com>",
@ -14,7 +14,7 @@
"@gm5/views": "^1.0.0",
"crypto.js": "^2.0.2",
"es.shim": "^2.0.1",
"iofs": "^1.5.0"
"iofs": "^1.5.3"
},
"devDependencies": {},
"repository": {