register.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>nps register</title>
  7. <link href="{{.web_base_url}}/static/css/bootstrap.min.css" rel="stylesheet">
  8. <link href="{{.web_base_url}}/static/font-awesome/css/font-awesome.css" rel="stylesheet">
  9. <link href="{{.web_base_url}}/static/css/style.css" rel="stylesheet">
  10. </head>
  11. <body class="gray-bg">
  12. <div class="middle-box text-center loginscreen animated fadeInDown">
  13. <div>
  14. <div>
  15. <h1 class="logo-name">NPS</h1>
  16. </div>
  17. <h3>register NPS</h3>
  18. <form class="m-t" role="form" onsubmit="return false">
  19. <div class="form-group">
  20. <input type="text" class="form-control" placeholder="username" name="username" required="">
  21. </div>
  22. <div class="form-group">
  23. <input type="password" class="form-control" placeholder="password" name="password" required="">
  24. </div>
  25. <button onclick="register()" type="submit" class="btn btn-primary block full-width m-b">register</button>
  26. <a class="btn btn-sm btn-white btn-block" href="{{.web_base_url}}/login/index">login</a>
  27. </form>
  28. </div>
  29. </div>
  30. <script src="{{.web_base_url}}/static/js/jquery-2.1.1.js"></script>
  31. <script>
  32. function register() {
  33. $.ajax({
  34. type: "POST",
  35. url: "{{.web_base_url}}/login/register",
  36. data: $("form").serializeArray(),
  37. success: function (res) {
  38. alert(res.msg)
  39. if (res.status) {
  40. window.location.href = "{{.web_base_url}}/login/index"
  41. }
  42. }
  43. })
  44. return false
  45. }
  46. </script>
  47. </body>
  48. </html>