mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: flow: support handler/:action/:name#:method
This commit is contained in:
1 parent
94244cb55f
commit
361e1c9b1c
1 file changed
+7
-5
@@ -254,16 +254,18 @@ async function handle(ctx: KoaContext, HandlerClass, checker) {
|
|||||||
|
|
||||||
const name = HandlerClass.name.replace(/Handler$/, '');
|
const name = HandlerClass.name.replace(/Handler$/, '');
|
||||||
const steps = [
|
const steps = [
|
||||||
'init', 'handler/init', `handler/before-prepare/${name}`, 'handler/before-prepare',
|
'init', 'handler/init',
|
||||||
'log/__prepare', '__prepare', '_prepare', 'prepare',
|
`handler/before-prepare/${name}#${method}`, `handler/before-prepare/${name}`, 'handler/before-prepare',
|
||||||
'log/__prepareDone', `handler/before/${name}`, 'handler/before',
|
'log/__prepare', '__prepare', '_prepare', 'prepare', 'log/__prepareDone',
|
||||||
|
`handler/before/${name}#${method}`, `handler/before/${name}`, 'handler/before',
|
||||||
'log/__method', 'all', method, 'log/__methodDone',
|
'log/__method', 'all', method, 'log/__methodDone',
|
||||||
...operation ? [
|
...operation ? [
|
||||||
`handler/before-operation/${name}`, 'handler/before-operation',
|
`handler/before-operation/${name}`, 'handler/before-operation',
|
||||||
`post${operation}`, 'log/__operationDone',
|
`post${operation}`, 'log/__operationDone',
|
||||||
] : [], 'after',
|
] : [], 'after',
|
||||||
`handler/after/${name}`, 'handler/after', 'cleanup',
|
`handler/after/${name}#${method}`, `handler/after/${name}`, 'handler/after',
|
||||||
`handler/finish/${name}`, 'handler/finish',
|
'cleanup',
|
||||||
|
`handler/finish/${name}#${method}`, `handler/finish/${name}`, 'handler/finish',
|
||||||
];
|
];
|
||||||
|
|
||||||
let current = 0;
|
let current = 0;
|
||||||
|
|||||||
Reference in new issue
Block a user