mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +08:00
fix: 修复自建插件保存丢失部署策略的bug
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user