login.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>login</title>
  8. <link rel="stylesheet" type="text/css" href="css/bootstrap-grid.min.css"/><!--CSS RESET-->
  9. <link href="http://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  10. <link rel="stylesheet" type="text/css" href="css/htmleaf-demo.css"><!--演示页面样式,使用时可以不引用-->
  11. <!--<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>-->
  12. <script src="./js/jquery-2.1.1.min.js"></script>
  13. <script src="./js/jqhttpsdk.js"></script>
  14. <script src="./js/jquery_cookie_min.js"></script>
  15. <script src="./js/jkcor.js"></script>
  16. <style>
  17. .demo {
  18. padding: 20px 0;
  19. background: linear-gradient(to right, #7AB6B6 50%, #E5CFAA 50%);
  20. }
  21. .form-horizontal {
  22. background-color: #fff;
  23. font-family: 'Arimo', sans-serif;
  24. text-align: center;
  25. padding: 50px 30px 50px;
  26. box-shadow: 12px 12px 0 0 rgba(0, 0, 0, 0.3);
  27. }
  28. .form-horizontal .heading {
  29. color: #555;
  30. font-size: 30px;
  31. font-weight: 600;
  32. letter-spacing: 1px;
  33. text-transform: capitalize;
  34. margin: 0 0 50px 0;
  35. }
  36. .form-horizontal .form-group {
  37. margin: 0 auto 30px;
  38. position: relative;
  39. }
  40. .form-horizontal .form-group:nth-last-child(2) {
  41. margin-bottom: 20px;
  42. }
  43. .form-horizontal .form-group:last-child {
  44. margin: 0;
  45. }
  46. .form-horizontal .form-group > i {
  47. color: #999;
  48. transform: translateY(-50%);
  49. position: absolute;
  50. left: 5px;
  51. top: 50%;
  52. }
  53. .form-horizontal .form-control {
  54. color: #7AB6B6;
  55. background-color: #fff;
  56. font-size: 17px;
  57. letter-spacing: 1px;
  58. height: 40px;
  59. padding: 5px 10px 2px 25px;
  60. box-shadow: 0 0 0 0 transparent;
  61. border: none;
  62. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  63. border-radius: 0;
  64. display: inline-block;
  65. }
  66. .form-control::placeholder {
  67. color: rgba(0, 0, 0, 0.2);
  68. font-size: 16px;
  69. }
  70. .form-horizontal .form-control:focus {
  71. border-bottom: 1px solid #7AB6B6;
  72. box-shadow: none;
  73. }
  74. .form-horizontal .btn {
  75. color: #7AB6B6;
  76. background-color: #EDF6F5;
  77. font-size: 18px;
  78. font-weight: 700;
  79. letter-spacing: 1px;
  80. border-radius: 5px;
  81. width: 50%;
  82. height: 45px;
  83. padding: 7px 30px;
  84. margin: 0 auto 25px;
  85. border: none;
  86. display: block;
  87. position: relative;
  88. transition: all 0.3s ease;
  89. }
  90. .form-horizontal .btn:focus,
  91. .form-horizontal .btn:hover {
  92. color: #fff;
  93. background-color: #7AB6B6;
  94. }
  95. .form-horizontal .btn:before,
  96. .form-horizontal .btn:after {
  97. content: '';
  98. background-color: #7AB6B6;
  99. height: 50%;
  100. width: 2px;
  101. position: absolute;
  102. left: 0;
  103. bottom: 0;
  104. z-index: 1;
  105. transition: all 0.3s;
  106. }
  107. .form-horizontal .btn:after {
  108. bottom: auto;
  109. top: 0;
  110. left: auto;
  111. right: 0;
  112. }
  113. .form-horizontal .btn:hover:before,
  114. .form-horizontal .btn:hover:after {
  115. height: 100%;
  116. width: 50%;
  117. opacity: 0;
  118. }
  119. .form-horizontal .create_account {
  120. color: #D6BC8B;
  121. font-size: 16px;
  122. font-weight: 600;
  123. display: inline-block;
  124. }
  125. .form-horizontal .create_account:hover {
  126. color: #7AB6B6;
  127. text-decoration: none;
  128. }
  129. </style>
  130. </head>
  131. <body>
  132. <div class="htmleaf-container">
  133. <header class="htmleaf-header" style="height: 200px;">
  134. <div class="htmleaf-links">
  135. </div>
  136. </header>
  137. <div class="demo form-bg">
  138. <div class="container">
  139. <div class="row">
  140. <div class="col-md-4"></div>
  141. <div class="col-md-4">
  142. <form class="form-horizontal">
  143. <div class="heading">Login form</div>
  144. <div class="form-group">
  145. <i class="fa fa-user"></i><input required name="login[username]" type="email"
  146. class="form-control" placeholder="Username"
  147. id="InputUsername">
  148. </div>
  149. <div class="form-group">
  150. <i class="fa fa-lock"></i><input required name="login[password]" type="password"
  151. class="form-control" placeholder="Password"
  152. id="InputPassword"/>
  153. </div>
  154. <div class="form-group">
  155. <button type="submit" class="btn btn-default" onClick="subLoginAction();return false;"><i
  156. class="fa fa-arrow-right"></i></button>
  157. <!--<span>Don't have an account? <a href="" class="create_account">Sign up</a></span>-->
  158. </div>
  159. </form>
  160. </div>
  161. <div class="col-md-4"></div>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. </body>
  167. <script type="text/javascript">
  168. function subLoginAction() {
  169. let username = $("#InputUsername").val();
  170. let password = $("#InputPassword").val();
  171. let post_data = {
  172. 'username': username,
  173. 'password': password
  174. };
  175. $.postJSON(
  176. http_ip_prot + 'user/login',
  177. JSON.stringify(post_data),
  178. function (data) {
  179. if (data['code'] == 0) {
  180. setCookie('access_token', data['res']['access_token'], data['res']['access_expire'])
  181. setCookie('refresh_token', data['res']['refresh_token'], data['res']['refresh_expire'])
  182. console.log(data)
  183. //window.location.href = "http://localhost:63339/web/index.html";
  184. window.location.href = "http://"+domain+":7724/web/index.html";
  185. } else {
  186. alert(data['msg'])
  187. }
  188. }
  189. );
  190. }
  191. </script>
  192. </html>