perf: 角色删除安全

pull/213/head
xiaojunnuo 2024-10-15 12:03:37 +08:00
parent 41ad0aea2b
commit 28bb4856be
1 changed files with 4 additions and 1 deletions

View File

@ -76,7 +76,10 @@ export class UserController extends CrudController<UserService> {
id: number
) {
if (id === 1) {
throw new Error('不能删除默认的管理员用户');
throw new Error('不能删除默认的管理员角色');
}
if (id === 3) {
throw new Error('不能删除默认的普通用户角色');
}
return await super.delete(id);
}