116 lines
3.6 KiB
HTML
116 lines
3.6 KiB
HTML
|
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
<head>
|
||
|
|
<meta charset="UTF-8">
|
||
|
|
<link rel="stylesheet" type="text/css" media="screen" href="../../../css/bootstrap.min.css">
|
||
|
|
</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>
|
||
|
|
<div class="form-group">
|
||
|
|
<label class="col-md-2 control-label">用户名</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">旧密码</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">新密码</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">再次输入新密码</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 style="" class="btn btn-primary" type="submit" onclick="update()">
|
||
|
|
<i class="fa fa-save"></i> 保存
|
||
|
|
</button>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</fieldset>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
<script type="text/javascript" src="../../../js/libs/jquery-3.7.1.min.js"></script>
|
||
|
|
<script type="text/javascript" src="../../../js/jq.js"></script>
|
||
|
|
<script type="text/javascript" src="../../../layui/layui.js"></script>
|
||
|
|
<script type="text/javascript" src="../../../js/my/roles/role.js"></script>
|
||
|
|
<script type="text/javascript" src="../../../js/publicJs.js"></script>
|
||
|
|
<script type="text/javascript" src="../../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
|
||
|
|
<script type="text/javascript">
|
||
|
|
var example = null;
|
||
|
|
var id = localStorage.getItem("id");
|
||
|
|
layui.use('layer', function(){
|
||
|
|
var layer = layui.layer;
|
||
|
|
});
|
||
|
|
init(id);
|
||
|
|
function init(id){
|
||
|
|
$.ajax({
|
||
|
|
type : 'get',
|
||
|
|
url : ctxPath + '/users/getPasswordInfo',
|
||
|
|
async : false,
|
||
|
|
data: {"id" : id},
|
||
|
|
dataType: 'json',
|
||
|
|
success : function(data) {
|
||
|
|
$("#id").val(data.id);
|
||
|
|
$("#userName").val(data.userName);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
function update() {
|
||
|
|
$('#form').bootstrapValidator();
|
||
|
|
var bootstrapValidator = $("#form").data('bootstrapValidator');
|
||
|
|
bootstrapValidator.validate();
|
||
|
|
if(!bootstrapValidator.isValid()){
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
$.ajax({
|
||
|
|
type : 'put',
|
||
|
|
url : ctxPath + '/users/'+$("#username").val(),
|
||
|
|
data : $("#form").serialize(),
|
||
|
|
success : function(data) {
|
||
|
|
layer.msg("修改成功", {shift: -1, time: 1000}, function(){
|
||
|
|
|
||
|
|
});
|
||
|
|
window.parent.location.href='userList.html';
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
</script>
|
||
|
|
</body>
|
||
|
|
</html>
|