chore: throw error when enable multi-app-manager in sub app (#6005)

This commit is contained in:
ChengLei Shao 2025-01-07 22:14:04 +08:00 committed by GitHub
parent 2b1614d99b
commit cd2418f3fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -173,6 +173,12 @@ export class PluginMultiAppManagerServer extends Plugin {
}); });
} }
async beforeEnable() {
if (this.app.name !== 'main') {
throw new Error('@nocobase/plugin-multi-app-manager can only be enabled in the main app');
}
}
async load() { async load() {
await this.importCollections(path.resolve(__dirname, 'collections')); await this.importCollections(path.resolve(__dirname, 'collections'));