|
@@ -0,0 +1,74 @@
|
|
|
|
|
+{% extends "layout.html" %}
|
|
|
|
|
+{% block head %}
|
|
|
|
|
+ {{ super() }}
|
|
|
|
|
+
|
|
|
|
|
+ <style type="text/css">
|
|
|
|
|
+
|
|
|
|
|
+ label>span {
|
|
|
|
|
+ color: deepskyblue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .btn,
|
|
|
|
|
+ .form-group>div>div,
|
|
|
|
|
+ .form-control {
|
|
|
|
|
+ border-radius: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ </style>
|
|
|
|
|
+{% endblock head %}
|
|
|
|
|
+{% block content %}
|
|
|
|
|
+ <script>
|
|
|
|
|
+ $(document).ready(function() {
|
|
|
|
|
+ $("#change_password_form").delegate('#submit_button', 'click', function() {
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url : '/api/user/_change_password',
|
|
|
|
|
+ type : 'POST',
|
|
|
|
|
+ contentType: "application/json; charset=utf-8",
|
|
|
|
|
+ dataType: "json",
|
|
|
|
|
+ data : JSON.stringify({old_password: $('#old_password').val(), password: $('#password').val()}),
|
|
|
|
|
+ error : function(data, textStatus, xhr) {
|
|
|
|
|
+ if (data.status === 401) {
|
|
|
|
|
+ alter_warning('当前密码有误!');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ alter_danger(data.responseText);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ success : function(data, textStatus, xhr) {
|
|
|
|
|
+ alter_success('密码修改成功!');
|
|
|
|
|
+ setTimeout(function() {
|
|
|
|
|
+ window.location.href="/";
|
|
|
|
|
+ }, 1000);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ </script>
|
|
|
|
|
+ <div class="panel">
|
|
|
|
|
+ <div class="panel-body">
|
|
|
|
|
+ <h3 class="title-hero" style="text-transform: unset;">
|
|
|
|
|
+ 修改密码
|
|
|
|
|
+ </h3>
|
|
|
|
|
+ <div class="example-box-wrapper">
|
|
|
|
|
+ <form id="change_password_form" class="form-horizontal bordered-row">
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="col-sm-2 control-label">当前密码</label>
|
|
|
|
|
+ <div class="col-sm-3">
|
|
|
|
|
+ <input title="当前密码" class="form-control" id="old_password" name="old_password" type="password">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="col-sm-2 control-label">新密码</label>
|
|
|
|
|
+ <div class="col-sm-3">
|
|
|
|
|
+ <input title="新密码" class="form-control" id="password" name="password" type="password">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="col-sm-2 control-label"></label>
|
|
|
|
|
+ <div class="col-sm-3 pull-right">
|
|
|
|
|
+ <button id="submit_button" type="button" class="btn btn-blue-alt" style="width: 180px; height: 40px; font-size: 16px;">确定</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+{% endblock content %}
|