From 083731d07e335f02f65bfdfc0bd8df655e830afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Wed, 12 Sep 2018 22:59:34 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E7=94=A8=E6=88=B7=E8=AF=AF?= =?UTF-8?q?=E5=88=A0jsh=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/jsh/action/basic/UserAction.java | 11 ++-- src/main/webapp/pages/manage/user.jsp | 65 ++++++++++--------- src/main/webapp/pages/user/password.jsp | 4 ++ 3 files changed, 45 insertions(+), 35 deletions(-) diff --git a/src/main/java/com/jsh/action/basic/UserAction.java b/src/main/java/com/jsh/action/basic/UserAction.java index bb67b01c..11eae985 100644 --- a/src/main/java/com/jsh/action/basic/UserAction.java +++ b/src/main/java/com/jsh/action/basic/UserAction.java @@ -122,9 +122,8 @@ public class UserAction extends BaseAction { user.setDepartment(model.getDepartment()); user.setDescription(model.getDescription()); user.setEmail(model.getEmail()); -// user.setIsmanager(model.getIsmanager()); - user.setIsystem((short) 1); user.setIsmanager((short) 1); + user.setIsystem((short) 0); user.setLoginame(model.getLoginame()); String password = "123456"; //因密码用MD5加密,需要对密码进行转化 @@ -244,7 +243,11 @@ public class UserAction extends BaseAction { String orgPassword = Tools.md5Encryp(model.getOrgpwd()); 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); userService.update(user); @@ -401,7 +404,7 @@ public class UserAction extends BaseAction { item.put("status", user.getStatus()); item.put("description", Tools.dealNullStr(user.getDescription())); item.put("remark", user.getRemark()); - item.put("op", user.getIsystem()); + item.put("op", user.getIsmanager()); dataArray.add(item); } } diff --git a/src/main/webapp/pages/manage/user.jsp b/src/main/webapp/pages/manage/user.jsp index 37727e2d..0ee16d95 100644 --- a/src/main/webapp/pages/manage/user.jsp +++ b/src/main/webapp/pages/manage/user.jsp @@ -158,7 +158,7 @@ pageSize: initPageSize, pageList: initPageNum, columns: [[ - {field: 'id', width: 35, align: "center", checkbox: true}, + {field: 'id', width: 35, align: "center", checkbox:true}, {title: '用户名称', field: 'username', width: 80}, {title: '登录名称', field: 'loginame', width: 80, align: "center"}, {title: '职位', field: 'position', width: 115, align: "center"}, @@ -176,12 +176,10 @@ if (1 == value) { str += ' 编辑  '; str += ' 删除  '; - //str += ' 用户  '; } - //else - //{ - //str += ' 管理  '; - //} + else { + str += ''; + } return str; } } @@ -306,32 +304,37 @@ } ids += row[i].id + ","; } - $.ajax({ - type: "post", - url: "<%=path %>/user/batchDelete.action", - dataType: "json", - async: false, - data: ({ - userIDs: ids, - clientIp: '<%=clientIp %>' - }), - success: function (tipInfo) { - var msg = tipInfo.showModel.msgTip; - if (msg == '成功') { - //$('#tableData').datagrid('reload'); - //加载完以后重新初始化 - $("#searchBtn").click(); - $(":checkbox").attr("checked", false); + if(row[i].loginame == "jsh"){ + $.messager.alert('提示', '管理员jsh不能删除!', 'warning'); + return; + } else { + $.ajax({ + type: "post", + url: "<%=path %>/user/batchDelete.action", + dataType: "json", + async: false, + data: ({ + userIDs: ids, + clientIp: '<%=clientIp %>' + }), + success: function (tipInfo) { + var msg = tipInfo.showModel.msgTip; + if (msg == '成功') { + //$('#tableData').datagrid('reload'); + //加载完以后重新初始化 + $("#searchBtn").click(); + $(":checkbox").attr("checked", false); + } + else + $.messager.alert('删除提示', '删除用户信息失败,请稍后再试!', 'error'); + }, + //此处添加错误处理 + error: function () { + $.messager.alert('删除提示', '删除用户信息异常,请稍后再试!', 'error'); + return; } - else - $.messager.alert('删除提示', '删除用户信息失败,请稍后再试!', 'error'); - }, - //此处添加错误处理 - error: function () { - $.messager.alert('删除提示', '删除用户信息异常,请稍后再试!', 'error'); - return; - } - }); + }); + } } }); } diff --git a/src/main/webapp/pages/user/password.jsp b/src/main/webapp/pages/user/password.jsp index 6235b6ae..c233af87 100644 --- a/src/main/webapp/pages/user/password.jsp +++ b/src/main/webapp/pages/user/password.jsp @@ -106,6 +106,10 @@ $("#orgTipMsg").empty().append("原始密码输入错误"); return; } + else if (3 == tipInfo) { + $.messager.alert('提示', '管理员jsh密码不能修改!', 'warning'); + return; + } else { $.messager.alert('提示', '更新密码异常,请稍后再试!', 'error'); return;