<!DOCTYPE html>
|
<html>
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="Expires" content="0"><meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-control" content="no-cache"><meta http-equiv="Cache" content="no-cache">
|
<title>修改密码</title>
|
<link href="../../css/common.css" rel="stylesheet" type="text/css">
|
<link href="../../css/control.css" rel="stylesheet" type="text/css">
|
<script src="../../js/vue/vue.js"></script>
|
<script src="../../js/myelement.js?v=20220425"></script>
|
<script src="../../js/vue/page.js?v=20220425"></script>
|
<script src="../../data/data.js?v=20220425"></script>
|
|
<script src="../../js/jquery-3.5.1.min.js"></script>
|
<style type="text/css">
|
input {
|
border-radius: 4px;
|
border-color: #C0C4CC;
|
}
|
input:active {
|
border-color: #66b1ff;
|
}
|
._button {
|
width: 100px;
|
height: 25px;
|
font: 12px 微软雅黑;
|
text-align: center;
|
cursor: pointer;
|
vertical-align: middle;
|
background-color: #409EFF;
|
border: hidden;
|
color: #fff;
|
border-radius: 4px;
|
}
|
._button:hover {
|
background-color: #66b1ff;
|
}
|
</style>
|
|
<script type="text/javascript" >
|
var password, password1, password2;
|
var lbl_pass, lbl_pass2;
|
|
function cancel() {
|
Root.hidePopup();
|
}
|
|
function changepass() {
|
var pass = password.val();
|
var pass1 = password1.val();
|
var pass2 = password2.val();
|
|
var f = validOriginal(pass);
|
if(!f) {
|
return;
|
}
|
f = validPassword(pass1);
|
if(!f) {
|
return;
|
}
|
|
f = validConfirm(pass2);
|
if(!f) {
|
return;
|
}
|
|
let param_ = {
|
passWord: pass,
|
newPassWord: pass1,
|
id:localStorage.getItem("id")
|
}
|
|
Server.call("root/client/changePassword", param_, function(result_) {
|
console.log(result_);
|
if (result_ && result_.success) {
|
Root.message({
|
type: 'success',
|
message: '密码修改成功'
|
});
|
Root.hidePopup();
|
}
|
});
|
/*var url = "root/user/changepassword?pass=" + pass1;
|
$.post(url, {},
|
function(data){
|
if(data.success) {
|
Dialog.alert("密码修改成功");
|
}
|
else {
|
Dialog.alert("密码修改失败!");
|
}
|
},
|
"json"
|
); */
|
}
|
|
function validOriginal(value) {
|
var pass = localStorage.getItem("password");//window.parent.user.password;
|
if(value != pass) {
|
lbl_pass.html("原始密码错误");
|
return false;
|
}else{
|
lbl_pass.html("");
|
return true;
|
}
|
}
|
|
function validPassword(value) {
|
var pwdRegex = new RegExp("(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,30}");
|
if (!pwdRegex.test(value)){
|
lbl_pass1.html("需包含大小写及特殊符号");
|
return false;
|
}else{
|
lbl_pass1.html("");
|
return true;
|
}
|
}
|
|
function validConfirm(value) {
|
var pass = password1.val();
|
if(value != pass) {
|
lbl_pass2.html("确认密码错误");
|
return false;
|
}else{
|
lbl_pass2.html("");
|
return true;
|
}
|
}
|
|
$(function(){
|
password = $("#edt_pass");
|
lbl_pass = $("#lbl_pass");
|
password1 = $("#edt_pass1");
|
password2 = $("#edt_pass2");
|
lbl_pass2 = $("#lbl_pass2");
|
lbl_pass1 = $("#lbl_pass1");
|
|
/* Win.onShow(function() {
|
password.val("");
|
password1.val("");
|
password2.val("");
|
lbl_pass.html("");
|
lbl_pass1.html("");
|
lbl_pass2.html("");
|
}) */
|
});
|
</script>
|
</head>
|
<body>
|
<div style="height:45px; font-size: 24px; text-align: center; line-height: 45px; font-weight: bold">更换密码</div>
|
<div style='margin-top: 40px'>
|
<div align="right" style="float: left; width: 130px; font: 15px 微软雅黑">旧密码:</div>
|
<div style="float: left;">
|
<input onblur="validOriginal(this.value);" id="edt_pass" size="20" type="password" style="width: 200px; font-size: 17px"/>
|
</div>
|
<label id='lbl_pass' style='float:left; margin-left: 5px; font: 12px 微软雅黑; color: red'></label>
|
<div style="clear: both; "></div>
|
<div align="right" style="float: left; width: 130px; font: 15px 微软雅黑; margin-top: 15px;">新密码:</div>
|
<div style="float: left; margin-top: 15px;">
|
<input onblur="validPassword(this.value);" id="edt_pass1" size="20" type="password" style="width: 200px; font-size: 17px"/>
|
</div>
|
<label id='lbl_pass1' style='float:left; margin-left: 5px; font: 12px 微软雅黑; color: red; margin-top: 15px;'></label>
|
<div style="clear: both; "></div>
|
<div align="right" style="float: left; width: 130px; font: 15px 微软雅黑; margin-top: 15px">确认密码:</div>
|
<div style="float: left; margin-top: 15px;">
|
<input onblur="validConfirm(this.value);" id="edt_pass2" size="20" type="password" style="width: 200px; font-size: 17px"/>
|
</div>
|
<label id='lbl_pass2' style='float:left; margin-left: 5px; font: 12px 微软雅黑; color: red; margin-top: 15px;'></label>
|
</div>
|
<div style="clear: both; "></div>
|
<div align="center" style="margin-top: 40px;">
|
<button class="_button" onclick="changepass();" style="margin: 0px 10px">保存</button>
|
<button class="_button" onclick="cancel();" style="margin: 0px 10px">退出</button>
|
</div>
|
</body>
|
</html>
|