mirror of
https://github.com/certd/certd.git
synced 2026-07-25 21:27:38 +08:00
chore: format
This commit is contained in:
@@ -9,28 +9,26 @@ export class AutoLoadPlugins {
|
||||
@Inject()
|
||||
pluginService: PluginService;
|
||||
|
||||
|
||||
async init() {
|
||||
logger.info(`加载插件开始,加载模式:${process.env.certd_plugin_loadmode}`);
|
||||
if (process.env.certd_plugin_loadmode === "metadata") {
|
||||
await this.pluginService.registerFromLocal("./metadata")
|
||||
}else{
|
||||
await this.pluginService.registerFromLocal("./metadata");
|
||||
} else {
|
||||
// await import("../../plugins/index.js")
|
||||
const fs = await import("fs");
|
||||
const list = fs.readdirSync("./dist/plugins");
|
||||
console.log("list", list);
|
||||
for (const file of list) {
|
||||
if (!file.includes(".")){
|
||||
if (!file.includes(".")) {
|
||||
logger.info(`加载插件文件:${file}`);
|
||||
await import(`../../plugins/${file}/index.js`);
|
||||
}
|
||||
}
|
||||
}
|
||||
// await import("../../plugins/index.js")
|
||||
await this.pluginService.registerFromDb()
|
||||
await this.pluginService.registerFromDb();
|
||||
|
||||
await registerPaymentProviders();
|
||||
logger.info(`加载插件完成,加载模式:${process.env.certd_plugin_loadmode}`);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user