From f7e635c40cd3cfc467ef9d47f15a5b5bd4a4611f Mon Sep 17 00:00:00 2001 From: undefined Date: Tue, 4 Mar 2025 12:09:15 +0800 Subject: [PATCH] core: fix startup --- packages/hydrooj/src/context.ts | 4 ++-- packages/hydrooj/src/service/server.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/hydrooj/src/context.ts b/packages/hydrooj/src/context.ts index 29f77a202..8701456ca 100644 --- a/packages/hydrooj/src/context.ts +++ b/packages/hydrooj/src/context.ts @@ -1,5 +1,5 @@ import * as cordis from '@cordisjs/core'; -import { Logger } from '@cordisjs/logger'; +import LoggerService from '@cordisjs/logger'; import { TimerService } from '@cordisjs/plugin-timer'; import Schema from 'schemastery'; import type { DomainDoc, GeoIP, ModuleInterfaces } from './interface'; @@ -72,7 +72,7 @@ export class Context extends cordis.Context { super(); this.plugin(ApiMixin); this.plugin(TimerService); - this.plugin(Logger); + this.plugin(LoggerService); } } diff --git a/packages/hydrooj/src/service/server.ts b/packages/hydrooj/src/service/server.ts index e0878dca1..7a67d30eb 100644 --- a/packages/hydrooj/src/service/server.ts +++ b/packages/hydrooj/src/service/server.ts @@ -219,7 +219,7 @@ export async function apply(ctx: Context) { ? (!host.includes(this.request.host)) : this.request.host !== host) )) withDomainId ||= domainId; - res = ctx.server.router.url.call(ctx.server.router, name, args, { query }).toString(); + res = server.router.url.call(server.router, name, args, { query }).toString(); if (anchor) res = `${res}#${anchor}`; if (withDomainId) res = `/d/${withDomainId}${res}`; } catch (e) {