fix: 修复自建插件保存丢失部署策略的bug

This commit is contained in:
xiaojunnuo
2025-05-16 23:50:18 +08:00
parent aebb07c5cc
commit 863e74dd2e
7 changed files with 25 additions and 15 deletions
@@ -44,9 +44,6 @@ export class PluginController extends CrudController<PluginService> {
async update(@Body(ALL) bean: any) {
const res = await super.update(bean);
// 更新插件配置
const info = await this.service.info(bean.id)
await this.service.registerPlugin(info)
return res
}
@@ -350,12 +350,15 @@ export class PluginService extends BaseService<PluginEntity> {
async registerPlugin(plugin: PluginEntity) {
const metadata = plugin.metadata ? yaml.load(plugin.metadata) : {};
const extra = plugin.extra ? yaml.load(plugin.extra) : {};
const item = {
...plugin,
...metadata
...metadata,
...extra
};
delete item.metadata;
delete item.content;
delete item.extra;
if (item.author) {
item.name = item.author + "/" + item.name;
}