From 7f14dba278ab458117d697a78813af92a56d0f48 Mon Sep 17 00:00:00 2001 From: Xc Date: Tue, 7 Oct 2025 18:02:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B0=E5=AF=8C=E4=BA=86initialize=E6=97=B6?= =?UTF-8?q?=E5=80=99=E5=AF=B9=E7=8E=B0=E6=9C=89=E6=95=B0=E6=8D=AE=E7=9A=84?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/AppLoader.d.ts | 2 +- lib/AppLoader.js | 4 ++-- src/AppLoader.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/AppLoader.d.ts b/lib/AppLoader.d.ts index 2f9317d..817920a 100644 --- a/lib/AppLoader.d.ts +++ b/lib/AppLoader.d.ts @@ -35,7 +35,7 @@ export declare class AppLoader; - initialize(): Promise; + initialize(ifExists?: 'drop' | 'omit' | 'dropIfNotStatic'): Promise; getStore(): DbStore; getEndpoints(prefix: string): [string, "post" | "get" | "put" | "delete", string, (params: Record, headers: IncomingHttpHeaders, req: IncomingMessage, body?: any) => Promise<{ headers?: Record | undefined; diff --git a/lib/AppLoader.js b/lib/AppLoader.js index 723eb2f..4a82968 100644 --- a/lib/AppLoader.js +++ b/lib/AppLoader.js @@ -185,8 +185,8 @@ class AppLoader extends types_1.AppLoader { throw err; } } - async initialize() { - await this.dbStore.initialize({ ifExists: 'dropIfNotStatic' }); + async initialize(ifExists) { + await this.dbStore.initialize({ ifExists }); const data = this.requireSth('lib/data/index'); // oak-domain中只有i18n (0, assert_1.default)(data.i18n); diff --git a/src/AppLoader.ts b/src/AppLoader.ts index 46145ed..b7df0df 100644 --- a/src/AppLoader.ts +++ b/src/AppLoader.ts @@ -235,8 +235,8 @@ export class AppLoader