login.blade.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <style>
  2. .login-box {
  3. margin-top: -10rem;
  4. padding: 5px;
  5. }
  6. .login-card-body {
  7. padding: 1.5rem 1.8rem 1.6rem;
  8. }
  9. .card, .card-body {
  10. border-radius: .25rem
  11. }
  12. .login-btn {
  13. padding-left: 2rem!important;;
  14. padding-right: 1.5rem!important;
  15. }
  16. .content {
  17. overflow-x: hidden;
  18. }
  19. .form-group .control-label {
  20. text-align: left;
  21. }
  22. </style>
  23. <div class="login-page bg-40">
  24. <div class="login-box">
  25. <div class="login-logo mb-2">
  26. {{ trans('admin.site_name') }}
  27. </div>
  28. <div class="card">
  29. <div class="card-body login-card-body shadow-100">
  30. <p class="login-box-msg mt-1 mb-1">{{ __('admin.welcome_back') }}</p>
  31. <form id="login-form" method="POST" action="{{ admin_url('auth/login') }}">
  32. <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
  33. <fieldset class="form-label-group form-group position-relative has-icon-left">
  34. <input
  35. type="text"
  36. class="form-control {{ $errors->has('username') ? 'is-invalid' : '' }}"
  37. name="username"
  38. placeholder="{{ trans('admin.username') }}"
  39. value="{{ old('username') }}"
  40. required
  41. autofocus
  42. >
  43. <div class="form-control-position">
  44. <i class="feather icon-user"></i>
  45. </div>
  46. <label for="email">{{ trans('admin.username') }}</label>
  47. <div class="help-block with-errors"></div>
  48. @if($errors->has('username'))
  49. <span class="invalid-feedback text-danger" role="alert">
  50. @foreach($errors->get('username') as $message)
  51. <span class="control-label" for="inputError"><i class="feather icon-x-circle"></i> {{$message}}</span><br>
  52. @endforeach
  53. </span>
  54. @endif
  55. </fieldset>
  56. <fieldset class="form-label-group form-group position-relative has-icon-left">
  57. <input
  58. minlength="5"
  59. maxlength="20"
  60. id="password"
  61. type="password"
  62. class="form-control {{ $errors->has('password') ? 'is-invalid' : '' }}"
  63. name="password"
  64. placeholder="{{ trans('admin.password') }}"
  65. required
  66. autocomplete="current-password"
  67. >
  68. <div class="form-control-position">
  69. <i class="feather icon-lock"></i>
  70. </div>
  71. <label for="password">{{ trans('admin.password') }}</label>
  72. <div class="help-block with-errors"></div>
  73. @if($errors->has('password'))
  74. <span class="invalid-feedback text-danger" role="alert">
  75. @foreach($errors->get('password') as $message)
  76. <span class="control-label" for="inputError"><i class="feather icon-x-circle"></i> {{$message}}</span><br>
  77. @endforeach
  78. </span>
  79. @endif
  80. </fieldset>
  81. <fieldset class="form-label-group form-group position-relative has-icon-left">
  82. <input
  83. minlength="6"
  84. maxlength="6"
  85. id="captcha"
  86. type="captcha"
  87. class="form-control"
  88. name="captcha"
  89. placeholder="{{ trans('admin.captcha') }}"
  90. required
  91. >
  92. <div class="form-control-position">
  93. <i class="feather icon-image"></i>
  94. </div>
  95. <label for="captcha">{{ trans('admin.captcha') }}</label>
  96. <div class="help-block with-errors"></div>
  97. @if($errors->has('captcha'))
  98. <span class="invalid-feedback text-danger" role="alert">
  99. @foreach($errors->get('captcha') as $message)
  100. <span class="control-label" for="inputError"><i class="feather icon-x-circle"></i> {{$message}}</span><br>
  101. @endforeach
  102. </span>
  103. @endif
  104. <img src="/captcha?{{ time() }}" alt="captcha" class="captcha-img" onclick="this.src='/captcha?'+Math.random()">
  105. </fieldset>
  106. <div class="form-group d-flex justify-content-between align-items-center">
  107. <div class="text-left">
  108. @if(config('admin.auth.remember'))
  109. <fieldset class="checkbox">
  110. <div class="vs-checkbox-con vs-checkbox-primary">
  111. <input id="remember" name="remember" value="1" type="checkbox" {{ old('remember') ? 'checked' : '' }}>
  112. <span class="vs-checkbox">
  113. <span class="vs-checkbox--check">
  114. <i class="vs-icon feather icon-check"></i>
  115. </span>
  116. </span>
  117. <span> {{ trans('admin.remember_me') }}</span>
  118. </div>
  119. </fieldset>
  120. @endif
  121. </div>
  122. </div>
  123. <div class="form-group d-flex justify-content-between align-items-center">
  124. <div class="text-left">
  125. <a href="?lang=en">English</a>
  126. <a href="?lang=zh_CN">中文</a>
  127. </div>
  128. </div>
  129. <button type="submit" class="btn btn-primary float-right login-btn">
  130. {{ __('admin.login') }}
  131. &nbsp;
  132. <i class="feather icon-arrow-right"></i>
  133. </button>
  134. </form>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <script>
  140. Dcat.ready(function () {
  141. // ajax表单提交
  142. $('#login-form').form({
  143. validate: true,
  144. });
  145. });
  146. </script>