Commit b1edabf5 authored by Junling Bu's avatar Junling Bu
Browse files

超级管理员不能删除和修改,防止演示平台的管理员密码被修改造成不能登录。

parent f095dd02
...@@ -89,6 +89,12 @@ public class AdminController { ...@@ -89,6 +89,12 @@ public class AdminController {
if(adminId == null){ if(adminId == null){
return ResponseUtil.unlogin(); return ResponseUtil.unlogin();
} }
Integer anotherAdminId = admin.getId();
if(anotherAdminId.intValue() == 1){
return ResponseUtil.fail(403, "超级管理员不能修改");
}
adminService.updateById(admin); adminService.updateById(admin);
return ResponseUtil.ok(admin); return ResponseUtil.ok(admin);
} }
...@@ -101,7 +107,7 @@ public class AdminController { ...@@ -101,7 +107,7 @@ public class AdminController {
Integer anotherAdminId = admin.getId(); Integer anotherAdminId = admin.getId();
if(anotherAdminId.intValue() == 1){ if(anotherAdminId.intValue() == 1){
return ResponseUtil.fail(403, "超级用户不能删除"); return ResponseUtil.fail(403, "超级管理员不能删除");
} }
adminService.deleteById(anotherAdminId); adminService.deleteById(anotherAdminId);
return ResponseUtil.ok(); return ResponseUtil.ok();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment