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