mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 14:16:26 +00:00
feat: add importDemo option for plugin-client
This commit is contained in:
parent
a2006fdc6a
commit
7432a485eb
@ -40,6 +40,9 @@ export default {
|
||||
});
|
||||
const app = this.app;
|
||||
this.app.on('db.init', async () => {
|
||||
if (this.options.importDemo !== true) {
|
||||
return;
|
||||
}
|
||||
const transaction = await app.db.sequelize.transaction();
|
||||
const sqls = getInitSqls();
|
||||
try {
|
||||
|
@ -73,6 +73,7 @@ function createApp(opts) {
|
||||
app.plugin(
|
||||
require(`@nocobase/plugin-client/${__filename.endsWith('.ts') ? 'src' : 'lib'}/server`).default, {
|
||||
dist: path.resolve(process.cwd(), './dist'),
|
||||
importDemo: true,
|
||||
});
|
||||
|
||||
return app;
|
||||
|
Loading…
Reference in New Issue
Block a user