新增不能对管理员账号进行删除

This commit is contained in:
不做码农
2022-03-05 18:53:04 +08:00
parent acc10fde4a
commit 283472b424
3 changed files with 13 additions and 12 deletions

View File

@@ -150,7 +150,7 @@ namespace ZR.Admin.WebApi.Controllers.System
public IActionResult Remove(int userid = 0)
{
if (userid <= 0) { return ToResponse(ApiResult.Error(101, "请求参数错误")); }
if (userid == 1) return ToResponse(Infrastructure.ResultCode.FAIL, "不能删除管理员账号");
int result = UserService.DeleteUser(userid);
return ToResponse(ToJson(result));