mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: fix domain dashboard
This commit is contained in:
2 files changed
+4
-5
No files matched your search
@@ -73,8 +73,6 @@ class DomainRankHandler extends Handler {
|
||||
}
|
||||
|
||||
class ManageHandler extends Handler {
|
||||
domain: DomainDoc;
|
||||
|
||||
async prepare({ domainId }) {
|
||||
this.checkPerm(PERM.PERM_EDIT_DOMAIN);
|
||||
this.domain = await domain.get(domainId);
|
||||
|
||||
@@ -115,7 +115,7 @@ const ignoredLimit = `,${argv.options.ignoredLimit},`;
|
||||
|
||||
export class HandlerCommon {
|
||||
render: (name: string, args?: any) => Promise<void>;
|
||||
renderHTML: (name: string, args?: any) => Promise<string>;
|
||||
renderHTML: (name: string, args?: any) => string | Promise<string>;
|
||||
url: (name: string, args?: any) => string;
|
||||
translate: (key: string) => string;
|
||||
session: Record<string, any>;
|
||||
@@ -124,8 +124,8 @@ export class HandlerCommon {
|
||||
ctx: Context = global.app;
|
||||
|
||||
constructor(
|
||||
public context: KoaContext, public args: Record<string, any>,
|
||||
public request: HydroRequest, public response: HydroResponse,
|
||||
public context: KoaContext, public readonly args: Record<string, any>,
|
||||
public readonly request: HydroRequest, public response: HydroResponse,
|
||||
public user: User, public domain: DomainDoc, public UiContext: Record<string, any>,
|
||||
) {
|
||||
this.render = context.render.bind(context);
|
||||
@@ -243,6 +243,7 @@ async function handle(ctx: KoaContext, HandlerClass, checker) {
|
||||
args, request, response, user, domain, UiContext,
|
||||
} = ctx.HydroContext;
|
||||
Object.assign(args, ctx.params);
|
||||
console.log(ctx.HydroContext);
|
||||
const h = new HandlerClass(ctx, args, request, response, user, domain, UiContext);
|
||||
ctx.handler = h;
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user