|
|
@@ -111,12 +111,12 @@ public class adminManagerAction extends ActionSupport {
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
-// if (!PwdDefind.vertify(admin.getPassword())){
|
|
|
-// resultJson.put("message", "密码至少包含:大小写英文字母、数字、特殊符号,密码长度大于8位,小于20位");
|
|
|
-// resultJson.put("code", 500);
|
|
|
-// ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
-// return null;
|
|
|
-// }
|
|
|
+ if (!PwdDefind.vertify(admin.getPassword())){
|
|
|
+ resultJson.put("message", "密码至少包含:大小写英文字母、数字、特殊符号,密码长度大于8位,小于20位");
|
|
|
+ resultJson.put("code", 500);
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
StringBuilder getOneSqlx = new StringBuilder("");
|
|
|
getOneSqlx.append(" and admin_name = '").append(admin.getAdminName()).append("'");
|
|
|
AdminManager listc = adminManagerService.getOen(getOneSqlx.toString());
|
|
|
@@ -140,9 +140,6 @@ public class adminManagerAction extends ActionSupport {
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- resultJson.put("message", "未知异常:"+ e);
|
|
|
- resultJson.put("code", 205);
|
|
|
- ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
}
|
|
|
resultJson.put("message", "未知异常");
|
|
|
resultJson.put("code", 205);
|
|
|
@@ -215,9 +212,6 @@ public class adminManagerAction extends ActionSupport {
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- resultJson.put("message", "未知异常:"+ e);
|
|
|
- resultJson.put("code", 205);
|
|
|
- ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
}
|
|
|
resultJson.put("message", "未知异常");
|
|
|
resultJson.put("code", 205);
|
|
|
@@ -283,6 +277,72 @@ public class adminManagerAction extends ActionSupport {
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 描述:冻结账号
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String freezeAdmin(){
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
+ if (id == null) {
|
|
|
+ resultJson.put("message", "请传入id");
|
|
|
+ resultJson.put("code", 500);
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ AdminManager admin = adminManagerService.getById(id);
|
|
|
+ if (admin != null && !"".equals(admin)) {
|
|
|
+ admin.setStatus(0);
|
|
|
+ int m = adminManagerService.updateAdmin(admin);
|
|
|
+ if(m > 0){
|
|
|
+ resultJson.put("message", "冻结成功");
|
|
|
+ resultJson.put("code", 200);
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+ return null;
|
|
|
+ }else{
|
|
|
+ resultJson.put("message", "冻结失败");
|
|
|
+ resultJson.put("code", 502);
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resultJson.put("message", "未知异常");
|
|
|
+ resultJson.put("code", 205);
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 描述:解冻账号
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String thawAdmin(){
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
+ if (id == null) {
|
|
|
+ resultJson.put("message", "请传入id");
|
|
|
+ resultJson.put("code", 500);
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ AdminManager admin = adminManagerService.getById(id);
|
|
|
+ if (admin != null && !"".equals(admin)) {
|
|
|
+ admin.setStatus(1);
|
|
|
+ int m = adminManagerService.updateAdmin(admin);
|
|
|
+ if(m > 0){
|
|
|
+ resultJson.put("message", "解冻成功");
|
|
|
+ resultJson.put("code", 200);
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+ return null;
|
|
|
+ }else{
|
|
|
+ resultJson.put("message", "解冻成功");
|
|
|
+ resultJson.put("code", 502);
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resultJson.put("message", "未知异常");
|
|
|
+ resultJson.put("code", 205);
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -336,7 +396,10 @@ public class adminManagerAction extends ActionSupport {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 菜单查询
|
|
|
+ /**
|
|
|
+ * 描述:查询菜单
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public String getIndexList(){
|
|
|
JSONObject resultjson = new JSONObject();
|
|
|
StringBuilder s1 = new StringBuilder("");
|