core: fix domain dashboard

This commit is contained in:
undefined committed 2024-01-05 20:31:19 +08:00
1 parent 891ddcc094
commit 353935d3cf
2 files changed
+4 -5

No files matched your search

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