mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: remove Hydro.service.bus, Hydro.ui.template
This commit is contained in:
8 files changed
+193
-178
No files matched your search
@@ -115,5 +115,4 @@ export function apply(ctx: Context) {
|
||||
|
||||
export default app;
|
||||
|
||||
global.Hydro.service.bus = app as any;
|
||||
global.bus = app;
|
||||
@@ -238,12 +238,6 @@ export async function apply(ctx: Context) {
|
||||
h.translate = h.translate.bind(h);
|
||||
h.url = h.url.bind(h);
|
||||
h.ctx = h.ctx.extend({ domain: h.domain });
|
||||
h.renderHTML = ((orig) => function (name: string, args: Record<string, any>) {
|
||||
const s = name.split('.');
|
||||
let templateName = `${s[0]}.${args.domainId}.${s[1]}`;
|
||||
if (!global.Hydro.ui.template[templateName]) templateName = name;
|
||||
return orig(templateName, args);
|
||||
})(h.renderHTML).bind(h);
|
||||
});
|
||||
on('handler/create/http', async (h) => {
|
||||
if (!argv.options.benchmark && !h.notUsage) await h.limitRate('global', 5, 100);
|
||||
|
||||
Reference in new issue
Block a user