|
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>莱欧前台框架</title>
- <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
- <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
- <link href="css/animate.css" rel="stylesheet">
- <link href="css/style.css?v=4.1.0" rel="stylesheet">
- <script src="js/jquery.min.js?v=2.1.4"></script>
- <script src="js/bootstrap.min.js?v=3.3.6"></script>
- <!-- 模态框js -->
- <script src="js/demo.js?v=1.1"></script>
- <!-- 自定义js -->
- <script src="js/plugins/validate/jquery.validate.min.js"></script>
- <script src="js/plugins/validate/messages_zh.min.js"></script>
- <script src="js/demo/form-validate-demo.js?v1.0.1"></script>
- <script type="text/javascript">
- function updatapwd(){
- document.getElementById("div1").style.display="none";
- var password=$("#password").val();
- if(password==""|| password.length==0){
- $("#pwd1").html("新密码不能为空");
- document.getElementById("div1").style.display="block";
- return;
- }
- var pwdRegex = /^(?=.*\d)(?=.*[a-zA-Z])[\da-zA-Z]{6,16}$/;//new RegExp('(?=.*[0-9])(?=.*[a-zA-Z]).{8,16}');
- if(!pwdRegex.test(password)){
- $("#pwd1").html("密码必须为8~16位数字和字母的组合");
- document.getElementById("div1").style.display="block";
- return;
- }
- var confirm_password=$("#confirm_password").val();
- if(confirm_password==""){
- $("#pwd2").html("确认密码不能为空");
- document.getElementById("div2").style.display="block";
- return;
- }
- $.ajax({
- type:"Post",
- url:"../login/submitPassword.service",
- data:{
- password:password,
- confirm_password:confirm_password
- },
- dataType:"json",
- success:function(data){
- if(data.success=='true'){
- showModal(data.message);//提示框
- return;
- }else{
- showModal(data.message);//提示框
- return;
- }
- }
- });
- }
- </script>
- </head>
- <body class="gray-bg">
- <div class="wrapper wrapper-content animated fadeInRight">
- <div class="row">
- <div class="col-sm-10">
- <div class="ibox float-e-margins">
- <div class="ibox-title">
- <h5>修改密码</h5>
- </div>
- <div class="ibox-content">
- <form class="form-horizontal m-t" id="signupForm">
- <div class="form-group">
- <label class="col-sm-3 control-label"><font color=red>*</font> 密码:</label>
- <div class="col-sm-8">
- <input id="password" name="password" class="form-control" type="password">
- <div style="display: none" id="div1">
- <span id="pwd1" style="color: red;" ></span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-3 control-label"><font color=red>*</font> 确认密码:</label>
- <div class="col-sm-8">
- <input id="confirm_password" name="confirm_password" class="form-control" type="password" >
- <div style="display: none" id="div2">
- <span id="pwd2" style="color: red;"></span>
- </div>
- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请再次输入您的密码</span>
- </div>
- </div>
- <div style="display: none" id="div1">
- <span id="msg" style="color: red;"></span>
- </div>
- <label class="col-sm-3 control-label"></label>
- <span style="color: red;"> *注:密码必须为6~16位数字和字母的组合</span>
- <div class="form-group">
- <div class="col-sm-8 col-sm-offset-3" style="margin-top: 10px">
- <button class="btn btn-primary" type="button" onclick="updatapwd()">修改密码</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 模态框开始 -->
- <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
- ×
- </button>
- <h4 class="modal-title" id="myModalLabel">
- 提示
- </h4>
- </div>
- <div class="modal-body" id="mycontent">
-
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal" >关闭
- </button>
- <!-- <button type="button" class="btn btn-primary">
- 提交更改
- </button> -->
- </div>
- </div><!-- /.modal-content -->
- </div><!-- /.modal -->
- </div>
- <!-- 模态框结束 -->
- </body>
- </html>
|