ui: enhance resource load

This commit is contained in:
undefined committed 2021-12-29 18:00:53 +08:00
1 parent 354d6420d9
commit 221cdf8d7d
6 files changed
+67 -77

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.2.34",
"version": "3.2.35",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+2 -1
View File
@@ -698,7 +698,7 @@ async function handle(ctx, HandlerClass, checker) {
} else if (typeof h.post !== 'function') {
throw new MethodNotAllowedError(method);
}
} else if (typeof h[method] !== 'function') {
} else if (typeof h[method] !== 'function' && typeof h.all !== 'function') {
throw new MethodNotAllowedError(method);
}
@@ -712,6 +712,7 @@ async function handle(ctx, HandlerClass, checker) {
await bail(`handler/before/${HandlerClass.name.replace(/Handler$/, '')}`, h);
await bail('handler/before', h);
h.args.__method = Date.now();
if (h.all) await h.all(args);
if (h[method]) await h[method](args);
h.args.__methodDone = Date.now();
await bail(`handler/before-operation/${HandlerClass.name.replace(/Handler$/, '')}`, h);