mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
22 lines
591 B
TypeScript
22 lines
591 B
TypeScript
import { Autoload, Init, Inject, Scope, ScopeEnum } from "@midwayjs/core";
|
|
import { logger } from "@certd/basic";
|
|
import { PluginService } from "../plugin/service/plugin-service.js";
|
|
|
|
@Autoload()
|
|
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
|
export class AutoBLoadPlugins {
|
|
@Inject()
|
|
pluginService: PluginService;
|
|
|
|
|
|
@Init()
|
|
async init() {
|
|
logger.info('加载插件开始');
|
|
// await this.pluginService.registerFromLocal("./metadata")
|
|
await import("../../plugins/index.js")
|
|
await this.pluginService.registerFromDb()
|
|
logger.info('加载插件完成');
|
|
|
|
}
|
|
}
|