训练(题单)功能

This commit is contained in:
masnn committed 2020-04-16 22:19:31 +08:00
1 parent e06283c0cc
commit 97b0d782b9
24 files changed
+466 -105

No files matched your search

+3 -3
View File
@@ -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);