|
@@ -173,13 +173,16 @@ public class AdminController {
|
|
|
|
|
|
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
|
public void Delete(HttpServletRequest request, HttpServletResponse response){
|
|
public void Delete(HttpServletRequest request, HttpServletResponse response){
|
|
|
|
+ String idAdmin = request.getParameter("idAdmin");
|
|
String id = request.getHeader("id");
|
|
String id = request.getHeader("id");
|
|
Admin superAdmin = adminService.GetOne(Long.valueOf(id));
|
|
Admin superAdmin = adminService.GetOne(Long.valueOf(id));
|
|
if(superAdmin==null || false==superAdmin.getName().equalsIgnoreCase("superadmin")){
|
|
if(superAdmin==null || false==superAdmin.getName().equalsIgnoreCase("superadmin")){
|
|
HttpUtil.responseApiCode(request, response, ApiCode.ACCESS_DENIED);
|
|
HttpUtil.responseApiCode(request, response, ApiCode.ACCESS_DENIED);
|
|
return;
|
|
return;
|
|
|
|
+ }else if(superAdmin.getId()==Long.valueOf(idAdmin)){
|
|
|
|
+ HttpUtil.responseApiCode(request, response, ApiCode.PARAMETER_ERROR);
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
- String idAdmin = request.getParameter("idAdmin");
|
|
|
|
adminService.Delete(Long.valueOf(idAdmin));
|
|
adminService.Delete(Long.valueOf(idAdmin));
|
|
HttpUtil.responseOk(request, response);
|
|
HttpUtil.responseOk(request, response);
|
|
TrailController.Insert(adminService, trailService, request, "admin", Long.valueOf(idAdmin), " 删除管理员:" + idAdmin);
|
|
TrailController.Insert(adminService, trailService, request, "admin", Long.valueOf(idAdmin), " 删除管理员:" + idAdmin);
|