防止用户误删jsh用户
This commit is contained in:
@@ -122,9 +122,8 @@ public class UserAction extends BaseAction<UserModel> {
|
|||||||
user.setDepartment(model.getDepartment());
|
user.setDepartment(model.getDepartment());
|
||||||
user.setDescription(model.getDescription());
|
user.setDescription(model.getDescription());
|
||||||
user.setEmail(model.getEmail());
|
user.setEmail(model.getEmail());
|
||||||
// user.setIsmanager(model.getIsmanager());
|
|
||||||
user.setIsystem((short) 1);
|
|
||||||
user.setIsmanager((short) 1);
|
user.setIsmanager((short) 1);
|
||||||
|
user.setIsystem((short) 0);
|
||||||
user.setLoginame(model.getLoginame());
|
user.setLoginame(model.getLoginame());
|
||||||
String password = "123456";
|
String password = "123456";
|
||||||
//因密码用MD5加密,需要对密码进行转化
|
//因密码用MD5加密,需要对密码进行转化
|
||||||
@@ -244,7 +243,11 @@ public class UserAction extends BaseAction<UserModel> {
|
|||||||
String orgPassword = Tools.md5Encryp(model.getOrgpwd());
|
String orgPassword = Tools.md5Encryp(model.getOrgpwd());
|
||||||
String md5Pwd = Tools.md5Encryp(model.getPassword());
|
String md5Pwd = Tools.md5Encryp(model.getPassword());
|
||||||
//必须和原始密码一致才可以更新密码
|
//必须和原始密码一致才可以更新密码
|
||||||
if (orgPassword.equalsIgnoreCase(user.getPassword())) {
|
if(user.getLoginame().equals("jsh")){
|
||||||
|
flag = 3;
|
||||||
|
tipMsg = "管理员jsh不能修改密码";
|
||||||
|
tipType = 1;
|
||||||
|
} else if (orgPassword.equalsIgnoreCase(user.getPassword())) {
|
||||||
|
|
||||||
user.setPassword(md5Pwd);
|
user.setPassword(md5Pwd);
|
||||||
userService.update(user);
|
userService.update(user);
|
||||||
@@ -401,7 +404,7 @@ public class UserAction extends BaseAction<UserModel> {
|
|||||||
item.put("status", user.getStatus());
|
item.put("status", user.getStatus());
|
||||||
item.put("description", Tools.dealNullStr(user.getDescription()));
|
item.put("description", Tools.dealNullStr(user.getDescription()));
|
||||||
item.put("remark", user.getRemark());
|
item.put("remark", user.getRemark());
|
||||||
item.put("op", user.getIsystem());
|
item.put("op", user.getIsmanager());
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,12 +176,10 @@
|
|||||||
if (1 == value) {
|
if (1 == value) {
|
||||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editUser(\'' + rowInfo + '\');"/> <a onclick="editUser(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editUser(\'' + rowInfo + '\');"/> <a onclick="editUser(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||||
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteUser(' + rec.id + ');"/> <a onclick="deleteUser(' + rec.id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
str += '<img src="<%=path%>/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteUser(' + rec.id + ');"/> <a onclick="deleteUser(' + rec.id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||||
//str += '<img src="<%=path%>/images/user.png" style="cursor: pointer;width: 16px;height: 16px" onclick="editUser(\'' + rowInfo + '\');"/> <a onclick="editUser(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">用户</a> ';
|
|
||||||
}
|
}
|
||||||
//else
|
else {
|
||||||
//{
|
str += '';
|
||||||
//str += '<img src="<%=path%>/images/admin.png" style="cursor: pointer;width: 16px;height: 16px" onclick="editUser(\'' + rowInfo + '\');"/> <a onclick="editUser(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">管理</a> ';
|
}
|
||||||
//}
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -306,6 +304,10 @@
|
|||||||
}
|
}
|
||||||
ids += row[i].id + ",";
|
ids += row[i].id + ",";
|
||||||
}
|
}
|
||||||
|
if(row[i].loginame == "jsh"){
|
||||||
|
$.messager.alert('提示', '管理员jsh不能删除!', 'warning');
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "post",
|
type: "post",
|
||||||
url: "<%=path %>/user/batchDelete.action",
|
url: "<%=path %>/user/batchDelete.action",
|
||||||
@@ -333,6 +335,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,6 +106,10 @@
|
|||||||
$("#orgTipMsg").empty().append("<font color='red'>原始密码输入错误</font>");
|
$("#orgTipMsg").empty().append("<font color='red'>原始密码输入错误</font>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else if (3 == tipInfo) {
|
||||||
|
$.messager.alert('提示', '管理员jsh密码不能修改!', 'warning');
|
||||||
|
return;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$.messager.alert('提示', '更新密码异常,请稍后再试!', 'error');
|
$.messager.alert('提示', '更新密码异常,请稍后再试!', 'error');
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user