tachybase_todo/packages/plugin-system-settings/src/server.ts

28 lines
767 B
TypeScript
Raw Normal View History

2021-08-13 23:14:07 +08:00
import path from 'path';
import { Plugin, PluginOptions } from '@nocobase/server';
2021-08-13 23:14:07 +08:00
export default class PluginSystemSettings extends Plugin {
async beforeLoad() {
this.app.on('installing', async () => {
await this.db.getRepository('system_settings').create({
2021-12-06 21:23:34 +08:00
values: {
title: 'NocoBase',
logo: {
title: 'nocobase-logo',
filename: '682e5ad037dd02a0fe4800a3e91c283b.png',
extname: '.png',
mimetype: 'image/png',
url: 'https://nocobase.oss-cn-beijing.aliyuncs.com/682e5ad037dd02a0fe4800a3e91c283b.png',
},
2021-09-23 00:16:04 +08:00
},
});
2021-09-11 18:53:26 +08:00
});
}
async load() {
await this.app.db.import({
directory: path.resolve(__dirname, 'collections'),
});
}
}