mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: enhance resource load
This commit is contained in:
1 parent
354d6420d9
commit
221cdf8d7d
6 files changed
+67
-77
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "3.2.34",
|
||||
"version": "3.2.35",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user