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
c8041a6b
Commit
c8041a6b
authored
Apr 17, 2020
by
季圣华
Browse files
优化密码修改页面
parent
61b42302
Changes
2
Hide whitespace changes
Inline
Side-by-side
erp_web/js/modules/sys/sysLogin.js
View file @
c8041a6b
...
...
@@ -90,7 +90,7 @@ function loginFun() {
return
;
}
else
if
(
loginInfoTip
.
indexOf
(
"
user password error
"
)
!=
-
1
)
{
alert
(
"
用户
密码错误
"
);
alert
(
"
密码错误
"
);
return
;
}
else
if
(
loginInfoTip
.
indexOf
(
"
access service error
"
)
!=
-
1
)
{
...
...
erp_web/pages/user/password.html
View file @
c8041a6b
...
...
@@ -16,42 +16,48 @@
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<div
id=
"userDlg"
class=
"easyui-panel"
data-options=
"fit:true"
title=
"修改密码"
style=
"background-color:#EAF2FD;
"
<div
id=
"userDlg"
class=
"easyui-panel"
data-options=
"fit:true"
title=
"修改密码"
iconCls=
"icon-list"
style=
"padding:10px 20px
"
iconCls=
"icon-unlock"
>
<form
id=
"passwordFM"
method=
"post"
novalidate
>
<div
class=
"fitem"
style=
"padding:10px"
>
<label
id=
"passwordLabel"
>
原始密码
</label>
<input
type=
"password"
name=
"oldpassword"
id=
"oldpassword"
class=
"easyui-validatebox"
data-options=
"required:true,validType:'length[5,20]'"
style=
"width: 230px;height: 20px"
missingMessage=
"请输入原始密码"
/>
<span
id=
"orgTipMsg"
></span>
</div>
<div
class=
"fitem"
style=
"padding:10px"
>
<label
id=
"newPassword"
>
重设密码
</label>
<input
type=
"password"
name=
"password"
id=
"password"
class=
"easyui-validatebox"
data-options=
"required:true,validType:'length[5,20]'"
style=
"width: 230px;height: 20px"
missingMessage=
"请填写新密码"
/>
<span
id=
"orgTipMsg"
></span>
</div>
<div
class=
"fitem"
style=
"padding:10px"
>
<label
id=
"repasswordLabel"
>
再输一遍
</label>
<input
type=
"password"
name=
"repassword"
id=
"repassword"
class=
"easyui-validatebox"
style=
"width: 230px;height: 20px"
required=
"true"
class=
"easyui-validatebox"
validType=
"equals['#password']"
missingMessage=
"请再次填写新密码"
invalidMessage=
"两次密码输入不一致"
/>
<span
id=
"tipMsg"
></span>
</div>
<table
style=
"width:100%"
>
<tr>
<td
style=
"width:80px;"
>
原始密码
</td>
<td
style=
"padding:5px;"
>
<input
type=
"password"
name=
"oldpassword"
id=
"oldpassword"
class=
"easyui-textbox"
data-options=
"required:true,validType:'length[5,20]'"
style=
"width: 230px;"
missingMessage=
"请输入原始密码"
/>
</td>
</tr>
<tr>
<td>
重设密码
</td>
<td
style=
"padding:5px;"
>
<input
type=
"password"
name=
"password"
id=
"password"
class=
"easyui-textbox"
data-options=
"required:true,validType:'length[5,20]'"
style=
"width: 230px;"
missingMessage=
"请填写新密码"
/>
</td>
</tr>
<tr>
<td>
再输一遍
</td>
<td
style=
"padding:5px;"
>
<input
type=
"password"
name=
"repassword"
id=
"repassword"
class=
"easyui-textbox"
data-options=
"required:true,validType:'length[5,20]'"
style=
"width: 230px;"
missingMessage=
"请再次填写新密码"
/>
</td>
</tr>
<tr>
<td></td>
<td
style=
"padding:5px;"
>
<a
href=
"javascript:void(0)"
id=
"savepassword"
class=
"easyui-linkbutton"
iconCls=
"icon-save"
>
保存
</a>
<a
href=
"javascript:void(0)"
id=
"cancelpassword"
class=
"easyui-linkbutton"
iconCls=
"icon-redo"
>
重置
</a>
</td>
</tr>
</table>
</form>
<div
style=
"clear: both;"
>
</div>
<div
id=
"dlg-buttons"
>
<a
href=
"javascript:void(0)"
id=
"savepassword"
class=
"easyui-linkbutton"
iconCls=
"icon-save"
>
保存
</a>
<a
href=
"javascript:void(0)"
id=
"cancelpassword"
class=
"easyui-linkbutton"
iconCls=
"icon-redo"
>
重置
</a>
</div>
</div>
<script
type=
"text/javascript"
>
//初始化界面
$
(
function
()
{
$
(
"
#oldpassword
"
).
focus
();
$
(
'
#passwordFM
'
).
form
({
onSubmit
:
function
()
{
return
false
;
...
...
@@ -62,9 +68,9 @@
});
//重置
$
(
"
#cancelpassword
"
).
off
(
"
click
"
).
on
(
"
click
"
,
function
()
{
$
(
"
#oldpassword
"
).
val
(
"
"
);
$
(
"
#password
"
).
val
(
"
"
);
$
(
"
#repassword
"
).
val
(
"
"
);
$
(
"
#oldpassword
"
).
textbox
(
"
clear
"
);
$
(
"
#password
"
).
textbox
(
"
clear
"
);
$
(
"
#repassword
"
).
textbox
(
"
clear
"
);
});
//初始化键盘enter事件
$
(
document
).
keydown
(
function
(
event
)
{
...
...
@@ -80,8 +86,16 @@
$
(
"
#savepassword
"
).
unbind
().
bind
({
click
:
function
()
{
if
(
!
$
(
'
#passwordFM
'
).
form
(
'
validate
'
))
var
oldpassword
=
$
.
trim
(
$
(
"
#oldpassword
"
).
textbox
(
"
getValue
"
));
var
password
=
$
.
trim
(
$
(
"
#password
"
).
textbox
(
"
getValue
"
));
var
repassword
=
$
.
trim
(
$
(
"
#repassword
"
).
textbox
(
"
getValue
"
));
if
(
!
$
(
'
#passwordFM
'
).
form
(
'
validate
'
)){
return
;
}
if
(
password
!=
repassword
)
{
$
.
messager
.
alert
(
'
提示
'
,
'
两次密码输入不一致!
'
,
'
warning
'
);
return
;
}
$
.
ajax
({
type
:
"
post
"
,
url
:
"
/user/updatePwd
"
,
...
...
@@ -89,8 +103,8 @@
async
:
false
,
data
:
({
userId
:
sessionStorage
.
getItem
(
"
userId
"
),
password
:
$
.
trim
(
$
(
"
#password
"
).
val
())
,
oldpwd
:
$
.
trim
(
$
(
"
#
oldpassword
"
).
val
())
password
:
password
,
oldpwd
:
oldpassword
}),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
...
...
@@ -101,7 +115,7 @@
history
.
go
(
-
1
);
}
else
if
(
2
==
status
)
{
$
(
"
#orgTipMsg
"
).
empty
().
append
(
"
<font color='red'>原始密码输入错误</font>
"
);
$
.
messager
.
alert
(
'
提示
'
,
'
原始密码输入错误!
'
,
'
warning
'
);
return
;
}
else
if
(
3
==
status
)
{
...
...
@@ -123,17 +137,6 @@
});
}
});
//处理tip提示
$
(
"
#oldpassword
"
).
unbind
().
bind
({
'
click keyup
'
:
function
()
{
$
(
"
#orgTipMsg
"
).
empty
();
},
'
blur
'
:
function
()
{
$
(
"
#orgTipMsg
"
).
empty
();
}
});
</script>
</body>
</html>
\ No newline at end of file
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