超级管理员不能删除和修改,防止演示平台的管理员密码被修改造成不能登录。
This commit is contained in:
@@ -89,6 +89,12 @@ public class AdminController {
|
||||
if(adminId == null){
|
||||
return ResponseUtil.unlogin();
|
||||
}
|
||||
|
||||
Integer anotherAdminId = admin.getId();
|
||||
if(anotherAdminId.intValue() == 1){
|
||||
return ResponseUtil.fail(403, "超级管理员不能修改");
|
||||
}
|
||||
|
||||
adminService.updateById(admin);
|
||||
return ResponseUtil.ok(admin);
|
||||
}
|
||||
@@ -101,7 +107,7 @@ public class AdminController {
|
||||
|
||||
Integer anotherAdminId = admin.getId();
|
||||
if(anotherAdminId.intValue() == 1){
|
||||
return ResponseUtil.fail(403, "超级用户不能删除");
|
||||
return ResponseUtil.fail(403, "超级管理员不能删除");
|
||||
}
|
||||
adminService.deleteById(anotherAdminId);
|
||||
return ResponseUtil.ok();
|
||||
|
||||
Reference in New Issue
Block a user