mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 07:56:26 +00:00
36 lines
702 B
TypeScript
36 lines
702 B
TypeScript
|
import { Plugin } from '@nocobase/server';
|
||
|
|
||
|
export class ClientPlugin extends Plugin {
|
||
|
async beforeLoad() {
|
||
|
const cmd = this.app.findCommand('install');
|
||
|
if (cmd) {
|
||
|
cmd.option('--import-demo');
|
||
|
cmd.option('--lang [lang]');
|
||
|
}
|
||
|
|
||
|
this.app.on('afterInstall', async (app, options) => {
|
||
|
const [opts] = options?.cliArgs || [{}];
|
||
|
if (opts?.importDemo) {
|
||
|
}
|
||
|
if (opts?.lang) {
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
async load() {
|
||
|
this.app.resource({
|
||
|
name: 'app',
|
||
|
actions: {
|
||
|
async getLang(ctx, next) {
|
||
|
ctx.body = {
|
||
|
lang: 'zh-CN',
|
||
|
};
|
||
|
await next();
|
||
|
},
|
||
|
},
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default ClientPlugin;
|