Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
083731d0
Commit
083731d0
authored
Sep 12, 2018
by
季圣华
Browse files
防止用户误删jsh用户
parent
f3e536ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/action/basic/UserAction.java
View file @
083731d0
...
...
@@ -122,9 +122,8 @@ public class UserAction extends BaseAction<UserModel> {
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<UserModel> {
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<UserModel> {
item
.
put
(
"status"
,
user
.
getStatus
());
item
.
put
(
"description"
,
Tools
.
dealNullStr
(
user
.
getDescription
()));
item
.
put
(
"remark"
,
user
.
getRemark
());
item
.
put
(
"op"
,
user
.
getIs
ystem
());
item
.
put
(
"op"
,
user
.
getIs
manager
());
dataArray
.
add
(
item
);
}
}
...
...
src/main/webapp/pages/manage/user.jsp
View file @
083731d0
...
...
@@ -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
+=
'
<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
%>
/images/user.png
"
style
=
"
cursor: pointer;width: 16px;height: 16px
"
onclick
=
"
editUser(
\
'' + rowInfo + '
\
');
"
/>&
nbsp
;
<
a
onclick
=
"
editUser(
\
'' + rowInfo + '
\
');
"
style
=
"
text-decoration:none;color:black;
"
href
=
"
javascript:void(0)
"
>
用户
<
/a> ';
}
//else
//{
//str += '
<
img
src
=
"
<%=
path
%>
/images/admin.png
"
style
=
"
cursor: pointer;width: 16px;height: 16px
"
onclick
=
"
editUser(
\
'' + rowInfo + '
\
');
"
/>&
nbsp
;
<
a
onclick
=
"
editUser(
\
'' + rowInfo + '
\
');
"
style
=
"
text-decoration:none;color:black;
"
href
=
"
javascript:void(0)
"
>
管理
<
/a> ';
//}
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
;
}
});
});
}
}
});
}
...
...
src/main/webapp/pages/user/password.jsp
View file @
083731d0
...
...
@@ -106,6 +106,10 @@
$
(
"
#orgTipMsg
"
).
empty
().
append
(
"
<font color='red'>原始密码输入错误</font>
"
);
return
;
}
else
if
(
3
==
tipInfo
)
{
$
.
messager
.
alert
(
'
提示
'
,
'
管理员jsh密码不能修改!
'
,
'
warning
'
);
return
;
}
else
{
$
.
messager
.
alert
(
'
提示
'
,
'
更新密码异常,请稍后再试!
'
,
'
error
'
);
return
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment