diff --git a/packages/plugins/@nocobase/plugin-multi-app-manager/src/server/server.ts b/packages/plugins/@nocobase/plugin-multi-app-manager/src/server/server.ts index fb627fdf2d..769b302baf 100644 --- a/packages/plugins/@nocobase/plugin-multi-app-manager/src/server/server.ts +++ b/packages/plugins/@nocobase/plugin-multi-app-manager/src/server/server.ts @@ -13,7 +13,10 @@ import lodash from 'lodash'; import path from 'path'; import { ApplicationModel } from '../server'; -export type AppDbCreator = (app: Application, options?: Transactionable & { context?: any }) => Promise; +export type AppDbCreator = ( + app: Application, + options?: Transactionable & { context?: any; applicationModel?: ApplicationModel }, +) => Promise; export type AppOptionsFactory = (appName: string, mainApp: Application) => any; export type SubAppUpgradeHandler = (mainApp: Application) => Promise; @@ -189,17 +192,22 @@ export class PluginMultiAppManagerServer extends Plugin { appOptionsFactory: this.appOptionsFactory, }); - // create database - await this.appDbCreator(subApp, { - transaction, - context: options.context, - }); + const quickstart = async () => { + // create database + await this.appDbCreator(subApp, { + transaction, + applicationModel: model, + context: options.context, + }); - const startPromise = subApp.runCommand('start', '--quickstart'); + const startPromise = subApp.runCommand('start', '--quickstart'); - if (options?.context?.waitSubAppInstall) { - await startPromise; - } + if (options?.context?.waitSubAppInstall) { + await startPromise; + } + }; + + quickstart(); }, );