login.blade.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="csrf-token" content="{{ csrf_token() }}">
  6. <meta name="viewport"
  7. content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  8. <title>后台管理</title>
  9. <meta name="renderer" content="webkit|ie-comp|ie-stand">
  10. <meta name="description" content="">
  11. <meta name="keywords" content="">
  12. <link rel="shortcut icon" href="/favicon.png" type="image/x-icon">
  13. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  14. <meta http-equiv="Cache-Control" content="no-siteapp"/>
  15. <link rel="stylesheet" href="/css/admin/font.css">
  16. <link rel="stylesheet" href="/css/admin/weadmin.css">
  17. <script src="/js/jquery.min.js"></script>
  18. <script src="/js/admin/js.cookie.js"></script>
  19. <script src="/layui/layui.js" charset="utf-8"></script>
  20. <style>
  21. .login input.layui-btn-disabled, .login input.layui-btn-disabled:active, .login input.layui-btn-disabled:hover {
  22. border: 1px solid #e6e6e6;
  23. background-color: #FBFBFB;
  24. color: #C9C9C9;
  25. cursor: not-allowed;
  26. opacity: 1;
  27. }
  28. .login-bg {
  29. background-image: url('/images/login_bg.jpg');
  30. }
  31. .login {
  32. min-height: 990px;
  33. max-width: 990px;
  34. padding: 0;
  35. background-color: transparent;
  36. margin-top: 10%;
  37. }
  38. .login .message {
  39. margin: 40px 0 0;
  40. padding: 0 20px;
  41. background: transparent;
  42. position: relative;
  43. color: #fff;
  44. font-size: 16px;
  45. text-align: center;
  46. }
  47. .login .message h1 {
  48. font-size: 72px;
  49. }
  50. .login .message p {
  51. font-size: 42px;
  52. margin-top: 30px;
  53. }
  54. .login input[type=text], .login input[type=password] {
  55. width: 400px;
  56. height: 60px;
  57. font-size: 20px;
  58. color: #555;
  59. padding: 0 46px;
  60. margin-top: 30px;
  61. border-radius: 60px;
  62. }
  63. .login input[type=text]::-webkit-input-placeholder, .login input[type=password]::-webkit-input-placeholder {
  64. color: #BDC3C7;
  65. }
  66. .login input[type=text]::-moz-placeholder, .login input[type=password]::-moz-placeholder { /* Mozilla Firefox 19+ */
  67. color: #BDC3C7;
  68. }
  69. .login input[type=text]:-moz-placeholder, .login input[type=password]:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
  70. color: #BDC3C7;
  71. }
  72. .login input[type=text]:-ms-input-placeholder, .login input[type=password]:-ms-input-placeholder { /* Internet Explorer 10-11 */
  73. color: #BDC3C7;
  74. }
  75. .login input[type=submit] {
  76. width: 220px;
  77. height: 70px;
  78. font-size: 32px;
  79. font-weight: bold;
  80. color: #2C3E50;
  81. background-color: #fff;
  82. margin: 40px 0 0 100px;
  83. border-radius: 70px;
  84. }
  85. .form-line {
  86. position: relative;
  87. }
  88. .form-line span {
  89. width: 33px;
  90. top: 16px;
  91. right: 40px;
  92. position: absolute;
  93. }
  94. </style>
  95. </head>
  96. <body class="login-bg">
  97. <div class="login">
  98. <div class="message">
  99. <h1>智慧矿山</h1>
  100. <p>智慧矿山视频管理系统</p>
  101. </div>
  102. <form method="post" class="layui-form" style="width: 400px;margin:60px auto 0;">
  103. @csrf
  104. <div class="form-line">
  105. <input name="staff_num" placeholder="工号" type="text" lay-verify="required" class="layui-input">
  106. <span><img src="/images/staff_num.png" alt=""></span>
  107. </div>
  108. <div class="form-line">
  109. <input name="password" lay-verify="required" placeholder="密码" type="password" class="layui-input">
  110. <span><img src="/images/password.png" alt=""></span>
  111. </div>
  112. <input class="loginin" value="登 陆" lay-submit lay-filter="login" type="submit">
  113. </form>
  114. </div>
  115. <script type="text/javascript">
  116. if (!Cookies.get('isIframe')) {
  117. Cookies.set('isIframe', true);
  118. parent.parent.location.reload();
  119. }
  120. layui.extend({
  121. admin: '/js/admin/admin'
  122. });
  123. layui.use(['form', 'admin'], function () {
  124. var form = layui.form
  125. , admin = layui.admin;
  126. //监听提交
  127. function btoaEnhanced(str) {
  128. return btoa(unescape(encodeURIComponent(str)));
  129. }
  130. function atobEnhanced(str) {
  131. return decodeURIComponent(escape(atob(str)));
  132. }
  133. form.on('submit(login)', function (data) {
  134. $('.loginin').addClass('layui-btn-disabled').prop('disabled', true).val('登陆中……');
  135. $.ajax({
  136. type: 'POST',
  137. url: '/admin/login',
  138. data: {staff_num: data.field.staff_num, password: btoaEnhanced(data.field.password)},
  139. headers: {
  140. 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  141. },
  142. success: function (res) {
  143. if (res.code === 0) {
  144. layer.msg(res.message, {anim: 0}, function () {
  145. location.href = '/admin';
  146. });
  147. } else {
  148. layer.msg(res.message, {anim: 0}, function () {
  149. location.reload();
  150. });
  151. }
  152. },
  153. error: function (res) {
  154. console.log(res.responseJSON);
  155. layer.msg(res.responseJSON.errors.staff_num[0]);
  156. },
  157. complete: function () {
  158. $('.loginin').removeClass('layui-btn-disabled').prop('disabled', false).val('登 陆');
  159. }
  160. });
  161. return false;
  162. });
  163. });
  164. </script>
  165. <!-- 底部结束 -->
  166. </body>
  167. <script>
  168. </script>
  169. </html>