forget.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. {% extends "index/base.html" %}
  2. {% block content %}
  3. <script type=text/javascript>
  4. $(document).ready(function(){
  5. $('a#clickCode').click(function() {
  6. $("#changeCode").attr("src","/validcode?code=" + Math.random());
  7. });
  8. $('button#ajax').click(function() {
  9. $.ajax ({
  10. type : "POST",
  11. url : "{{ url_for('auth.forget') }}",
  12. data:JSON.stringify({
  13. confirm_email: $('#confirm_email').val(),
  14. code:$("#code").val()
  15. }),
  16. contentType: 'application/json;charset=UTF-8',
  17. success: function(result) {
  18. if (result.judge == true)
  19. {
  20. window.location = '{{ url_for('auth.login') }}';
  21. }
  22. else
  23. {
  24. $("#showerror").show();
  25. $("#error").text(result.error);
  26. }
  27. }
  28. });
  29. });
  30. });
  31. </script>
  32. <ol class="breadcrumb" style="margin-bottom:0;">
  33. <li><a href="{{ url_for('forums.forums') }}"><span class="glyphicon glyphicon-home" aria-hidden="true"></span>社区首页</a></li>
  34. <li class="active">忘记密码</li>
  35. </ol>
  36. <div class="panel panel-primary">
  37. <div class="panel-heading" style="background:#2e609b;">
  38. <a href="{{ url_for('auth.forget') }}" style="color:#fff">忘记密码</a>
  39. </div>
  40. <div class="panel-body" style="border-bottom:1px solid #f6e1e1;">
  41. <table align="center" style="font-size:14px;">
  42. <tr>
  43. <td colspan="2">
  44. <div class="alert alert-info" id="showerror" style="padding:8px;">
  45. <button type="button" class="close" id="hide">
  46. <span aria-hidden="true">&times;</span>
  47. </button>
  48. <ul>
  49. <li id="error"></li>
  50. </ul>
  51. </div>
  52. </td>
  53. </tr>
  54. <tr>
  55. <td style="padding-right:5px;">{{ form.confirm_email.label }} </td>
  56. <td style="padding-bottom:10px;"> {{ form.confirm_email(class="form-control",placeholder="email",style="width:240px;") }}</td>
  57. </tr>
  58. <tr>
  59. <td>{{ form.code.label }}</td>
  60. <td colspan="2" style="padding-bottom:10px;">
  61. {% include 'auth/validate.html' %}
  62. </td>
  63. </tr>
  64. <tr>
  65. <td></td>
  66. <td style="padding-bottom:10px;">
  67. <button type="button" class="btn btn-primary" id="ajax">确认</button>
  68. </td>
  69. </tr>
  70. </table>
  71. </div>
  72. </div>
  73. {% endblock %}