index.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
  6. <title></title>
  7. <link rel="stylesheet" href="./bootstrap/css/bootstrap.min.css" />
  8. <link rel="stylesheet" href="./bootstrap/css/bootstrap-theme.min.css" />
  9. <link rel="stylesheet" href="./css/index.css" />
  10. <script src="./js/jquery.js"></script>
  11. <script src="./bootstrap/js/bootstrap.min.js"></script>
  12. </head>
  13. <body>
  14. <div class="loginPage">
  15. <div class="loginItem">
  16. <div class="form">
  17. <img src="https://dangjian-web.oss-cn-chengdu.aliyuncs.com/img/logo.png"
  18. style="width: 289px;margin: 0 auto;display: block;margin-bottom: 131px;">
  19. <div class="login-head">
  20. <h3>用 户 登 录</h3>
  21. </div>
  22. <form>
  23. <div class="input-group">
  24. <span class="input-group-addon" id="basic-addon1">
  25. <svg t="1640764623435" class="icon" viewBox="0 0 1024 1024" version="1.1"
  26. xmlns="http://www.w3.org/2000/svg" p-id="2115" width="18" height="18">
  27. <path
  28. d="M498.602667 191.744a204.714667 204.714667 0 0 1 116.906666 372.8c133.162667 47.317333 229.077333 173.290667 231.893334 322.026667l0.085333 6.784h-64c0-157.333333-127.573333-284.885333-284.885333-284.885334-155.136 0-281.301333 123.968-284.821334 278.250667l-0.085333 6.613333h-64c0-151.68 96.810667-280.746667 232-328.810666a204.714667 204.714667 0 0 1 116.906667-372.8z m0 64a140.714667 140.714667 0 1 0 0 281.450667 140.714667 140.714667 0 0 0 0-281.450667z"
  29. fill="#1677FF" p-id="2116"></path>
  30. </svg>
  31. </span>
  32. <input type="text" class="form-control" placeholder="请输入账号" id="user"
  33. aria-describedby="basic-addon1">
  34. </div>
  35. <br />
  36. <div class="input-group">
  37. <span class="input-group-addon" id="basic-addon1">
  38. <svg t="1640764744340" class="icon" viewBox="0 0 1024 1024" version="1.1"
  39. xmlns="http://www.w3.org/2000/svg" p-id="2910" width="18" height="18">
  40. <path
  41. d="M512 768c-17.664 0-32-14.304-32-32l0-96c0-17.696 14.336-32 32-32s32 14.304 32 32l0 96C544 753.696 529.664 768 512 768z"
  42. p-id="2911" fill="#049aef"></path>
  43. <path
  44. d="M832 960 192 960c-52.928 0-96-43.072-96-96L96 512c0-52.928 43.072-96 96-96l640 0c52.928 0 96 43.072 96 96l0 352C928 916.928 884.928 960 832 960zM192 480c-17.632 0-32 14.368-32 32l0 352c0 17.664 14.368 32 32 32l640 0c17.664 0 32-14.336 32-32L864 512c0-17.632-14.336-32-32-32L192 480z"
  45. p-id="2912" fill="#049aef"></path>
  46. <path
  47. d="M736 480c-17.696 0-32-14.336-32-32L704 318.016C704 209.248 601.76 128 510.336 128 416.768 128 320 198.912 320 317.568L320 448c0 17.664-14.336 32-32 32s-32-14.336-32-32L256 317.568C256 158.848 385.312 64 510.336 64 632.224 64 768 168.32 768 318.016L768 448C768 465.664 753.696 480 736 480z"
  48. p-id="2913" fill="#049aef"></path>
  49. </svg>
  50. </span>
  51. <input class="form-control" type="password" placeholder="请输入密码" id="password"
  52. aria-describedby="basic-addon1">
  53. </div>
  54. <br />
  55. <br />
  56. <div style="text-align: center">
  57. <div class="btn btn-primary submit" style="border: none;margin: 0 70px;display:block;height: 39px;background: linear-gradient(-90deg, #23cffd, #1f81e7);opacity: 0.96;border-radius: 20px;">确 认</div>
  58. </div>
  59. </form>
  60. </div>
  61. </div>
  62. </div>
  63. <script src="./js/base.js"></script>
  64. <script>
  65. $(".submit").click(() => {
  66. const user = $("#user").val();
  67. const password = $("#password").val();
  68. console.log(user, password);
  69. if (!user || !password) {
  70. showAlert("请输入账号或密码");
  71. return;
  72. }
  73. $.post(Config.baseUrl + "/login", {
  74. username: user,
  75. password: password
  76. }, function (e) {
  77. console.log(e)
  78. if (e.code === 0) {
  79. localStorage.login = user
  80. localStorage.token = e.data.token;
  81. location.href = "./skeleton.html";
  82. } else {
  83. showAlert("账号或密码错误");
  84. }
  85. })
  86. });
  87. </script>
  88. </body>
  89. </html>