mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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 {
|
class ManageHandler extends Handler {
|
||||||
domain: DomainDoc;
|
|
||||||
|
|
||||||
async prepare({ domainId }) {
|
async prepare({ domainId }) {
|
||||||
this.checkPerm(PERM.PERM_EDIT_DOMAIN);
|
this.checkPerm(PERM.PERM_EDIT_DOMAIN);
|
||||||
this.domain = await domain.get(domainId);
|
this.domain = await domain.get(domainId);
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ const ignoredLimit = `,${argv.options.ignoredLimit},`;
|
|||||||
|
|
||||||
export class HandlerCommon {
|
export class HandlerCommon {
|
||||||
render: (name: string, args?: any) => Promise<void>;
|
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;
|
url: (name: string, args?: any) => string;
|
||||||
translate: (key: string) => string;
|
translate: (key: string) => string;
|
||||||
session: Record<string, any>;
|
session: Record<string, any>;
|
||||||
@@ -124,8 +124,8 @@ export class HandlerCommon {
|
|||||||
ctx: Context = global.app;
|
ctx: Context = global.app;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public context: KoaContext, public args: Record<string, any>,
|
public context: KoaContext, public readonly args: Record<string, any>,
|
||||||
public request: HydroRequest, public response: HydroResponse,
|
public readonly request: HydroRequest, public response: HydroResponse,
|
||||||
public user: User, public domain: DomainDoc, public UiContext: Record<string, any>,
|
public user: User, public domain: DomainDoc, public UiContext: Record<string, any>,
|
||||||
) {
|
) {
|
||||||
this.render = context.render.bind(context);
|
this.render = context.render.bind(context);
|
||||||
@@ -243,6 +243,7 @@ async function handle(ctx: KoaContext, HandlerClass, checker) {
|
|||||||
args, request, response, user, domain, UiContext,
|
args, request, response, user, domain, UiContext,
|
||||||
} = ctx.HydroContext;
|
} = ctx.HydroContext;
|
||||||
Object.assign(args, ctx.params);
|
Object.assign(args, ctx.params);
|
||||||
|
console.log(ctx.HydroContext);
|
||||||
const h = new HandlerClass(ctx, args, request, response, user, domain, UiContext);
|
const h = new HandlerClass(ctx, args, request, response, user, domain, UiContext);
|
||||||
ctx.handler = h;
|
ctx.handler = h;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in new issue
Block a user