mirror of
https://github.com/certd/certd.git
synced 2026-04-30 09:17:24 +08:00
perf: 角色删除安全
This commit is contained in:
@@ -76,7 +76,10 @@ export class UserController extends CrudController<UserService> {
|
|||||||
id: number
|
id: number
|
||||||
) {
|
) {
|
||||||
if (id === 1) {
|
if (id === 1) {
|
||||||
throw new Error('不能删除默认的管理员用户');
|
throw new Error('不能删除默认的管理员角色');
|
||||||
|
}
|
||||||
|
if (id === 3) {
|
||||||
|
throw new Error('不能删除默认的普通用户角色');
|
||||||
}
|
}
|
||||||
return await super.delete(id);
|
return await super.delete(id);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user