mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
训练(题单)功能
This commit is contained in:
1 parent
e06283c0cc
commit
97b0d782b9
24 files changed
+466
-105
No files matched your search
@@ -259,9 +259,9 @@ function Route(route, RouteHandler) {
|
||||
if (h[method]) await h[method](args);
|
||||
|
||||
if (method === 'post' && ctx.request.body.operation) {
|
||||
if (h[`${method}_${ctx.request.body.operation}`]) {
|
||||
await h[`${method}_${ctx.request.body.operation}`](args);
|
||||
}
|
||||
const operation = `_${ctx.request.body.operation}`
|
||||
.replace(/_([a-z])/gm, (s) => s[1].toUpperCase());
|
||||
if (h[`${method}${operation}`]) await h[`${method}${operation}`](args);
|
||||
}
|
||||
|
||||
if (h.cleanup) await h.cleanup(args);
|
||||
|
||||
Reference in new issue
Block a user