mirror of
https://github.com/certd/certd.git
synced 2026-10-13 07:38:56 +08:00
chore(plugin-service): 补全内置插件的installed字段赋值逻辑
为内置插件添加默认的installed状态设置,统一插件安装状态的处理逻辑,修复部分场景下插件安装状态不准确的问题
This commit is contained in:
@@ -712,6 +712,7 @@ export class PluginService extends BaseService<PluginEntity> {
|
||||
if (param.type === "builtIn") {
|
||||
return await super.add({
|
||||
disabled: false,
|
||||
installed: true,
|
||||
...param,
|
||||
});
|
||||
}
|
||||
@@ -736,6 +737,7 @@ export class PluginService extends BaseService<PluginEntity> {
|
||||
disabled: false,
|
||||
...param,
|
||||
...plugin,
|
||||
installed: true,
|
||||
});
|
||||
|
||||
await this.registerById(res.id);
|
||||
@@ -1009,13 +1011,14 @@ export class PluginService extends BaseService<PluginEntity> {
|
||||
const updateBean: Record<string, any> = {
|
||||
id: existingRecord.id,
|
||||
...itemFromStore,
|
||||
installed: false,
|
||||
};
|
||||
await this.updateById(updateBean);
|
||||
}
|
||||
|
||||
continue;
|
||||
} else {
|
||||
itemFromStore.disabled = false;
|
||||
itemFromStore.installed = false;
|
||||
await this.repository.save(itemFromStore);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user