fix: 修复自定义插件删除后没有反注册的bug

This commit is contained in:
xiaojunnuo
2026-04-07 23:36:05 +08:00
parent f7492db8bd
commit df98463325
4 changed files with 31 additions and 11 deletions
@@ -58,7 +58,8 @@ export class PluginController extends CrudController<PluginService> {
@Post('/delete', { description: 'sys:settings:edit' })
async delete(@Query('id') id: number) {
return super.deleteByIds([id]);
const res = await this.service.deleteByIds([id]);
return this.ok(res);
}
@Post('/deleteByIds', { description: 'sys:settings:edit' })
@@ -524,15 +524,12 @@ export class PluginService extends BaseService<PluginEntity> {
id: pluginEntity.id
};
}
async deleteByIds(ids: any[]) {
ids = this.filterIds(ids);
for (const id of ids) {
await this.unRegisterById(id)
await this.unRegisterById(id);
await this.delete(id);
}
}
}