2025-11-27 16:55:35 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<title>修改密码</title>
|
|
|
|
|
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
|
|
|
|
|
<link rel="stylesheet" type="text/css" media="screen" href="../../layui-v2.8.18/layui/css/layui.css">
|
|
|
|
|
<style>
|
|
|
|
|
.from-sty{
|
|
|
|
|
font: 16px "Helvetica Neue", Helvetica, "PingFang SC", Tahoma, Arial, sans-serif;
|
|
|
|
|
}
|
|
|
|
|
.button-sty{
|
|
|
|
|
height: 38px!important;
|
|
|
|
|
line-height: 38px!important;
|
|
|
|
|
font-size: 16px!important;
|
|
|
|
|
width: 90px!important;
|
|
|
|
|
background-color: #009688!important;
|
|
|
|
|
border-color: #009688!important;
|
|
|
|
|
color: #fff!important;
|
|
|
|
|
}
|
|
|
|
|
.form-control {
|
|
|
|
|
width: 82%;
|
|
|
|
|
height: 45px;
|
|
|
|
|
}
|
|
|
|
|
.button-sty {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
|
|
|
|
<form class="form-horizontal" onsubmit="return false" id="form">
|
|
|
|
|
<fieldset style="margin-top: 2%;">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 control-label from-sty">用户名</label>
|
|
|
|
|
<div class="col-md-10">
|
|
|
|
|
<input class="form-control" placeholder="用户名" type="text" id="username" readonly="readonly" name="username"
|
|
|
|
|
data-bv-notempty="true"
|
|
|
|
|
data-bv-notempty-message="用户名 不能为空">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 control-label from-sty"><i class="tip-required" style="color: red;font-size: 20px">*</i>旧密码:</label>
|
|
|
|
|
<div class="col-md-10">
|
|
|
|
|
<input class="form-control" placeholder="旧密码" type="text" name="oldPassword"
|
|
|
|
|
data-bv-notempty="true"
|
|
|
|
|
data-bv-notempty-message="旧密码 不能为空">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 control-label from-sty"><i class="tip-required" style="color: red;font-size: 20px">*</i>新密码:</label>
|
|
|
|
|
<div class="col-md-10">
|
|
|
|
|
<input class="form-control" placeholder="新密码" type="text" name="newPassword" id="newPassword"
|
|
|
|
|
data-bv-notempty="true"
|
|
|
|
|
data-bv-notempty-message="新密码 不能为空"
|
|
|
|
|
|
|
|
|
|
data-bv-identical="true"
|
|
|
|
|
data-bv-identical-field="newPassword2"
|
|
|
|
|
data-bv-identical-message="两次密码不一致">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-md-2 control-label from-sty"><i class="tip-required" style="color: red;font-size: 20px">*</i>再次输入新密码:</label>
|
|
|
|
|
<div class="col-md-10">
|
|
|
|
|
<input class="form-control" placeholder="再次输入新密码" type="text" name="newPassword2" id="newPassword2"
|
|
|
|
|
data-bv-notempty="true"
|
|
|
|
|
data-bv-notempty-message="再次输入新密码"
|
|
|
|
|
data-bv-identical="true"
|
|
|
|
|
data-bv-identical-field="newPassword"
|
|
|
|
|
data-bv-identical-message="两次密码不一致">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-actions">
|
|
|
|
|
<div class="row" align="center">
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
<button class="btn btn-primary button-sty" type="submit" onclick="update()">
|
|
|
|
|
<i class="fa fa-save" style="margin-right: 5px;"></i>保存
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</fieldset>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<script type="text/javascript" src="../../js/jquery/jquery-3.6.0.js"></script>
|
|
|
|
|
<script type="text/javascript" src="../../js/jq.js"></script>
|
|
|
|
|
<script type="text/javascript" src="../../layui-v2.8.18/layui/layui.js"></script>
|
|
|
|
|
<script type="text/javascript" src="../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
|
2025-12-09 18:44:29 +08:00
|
|
|
<script type="text/javascript" src="../../../public/public.js"></script>
|
2025-11-27 16:55:35 +08:00
|
|
|
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
layui.use('layer', function(){
|
|
|
|
|
var layer = layui.layer;
|
|
|
|
|
});
|
|
|
|
|
function init(){
|
|
|
|
|
$.ajax({
|
|
|
|
|
type : 'get',
|
2025-12-09 18:44:29 +08:00
|
|
|
url : czl_ht_url + '/users/current',
|
2025-11-27 16:55:35 +08:00
|
|
|
async : false,
|
|
|
|
|
data : $("#form").serialize(),
|
|
|
|
|
success : function(data) {
|
|
|
|
|
console.log(data)
|
|
|
|
|
$("#username").val(data.phone);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
init();
|
|
|
|
|
|
|
|
|
|
function update() {
|
|
|
|
|
$('#form').bootstrapValidator();
|
|
|
|
|
var bootstrapValidator = $("#form").data('bootstrapValidator');
|
|
|
|
|
bootstrapValidator.validate();
|
|
|
|
|
if(!bootstrapValidator.isValid()){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var regex = new RegExp('(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[^a-zA-Z0-9]).{8,20}');
|
|
|
|
|
if (!regex.test($("#newPassword").val())) {
|
|
|
|
|
layer.msg("您的密码复杂度太低(密码中必须包含大小字母、数字、特殊字符)!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
$.ajax({
|
|
|
|
|
type : 'put',
|
2025-12-09 18:44:29 +08:00
|
|
|
url : czl_ht_url + '/users/'+$("#username").val(),
|
2025-11-27 16:55:35 +08:00
|
|
|
data : $("#form").serialize(),
|
|
|
|
|
success : function(data) {
|
|
|
|
|
layer.msg("修改成功", {shift: -1, time: 1000}, function(){
|
|
|
|
|
// deleteCurrentTab();
|
|
|
|
|
location.reload();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|