123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- <style>
- .login-box {
- margin-top: -10rem;
- padding: 5px;
- }
- .login-card-body {
- padding: 1.5rem 1.8rem 1.6rem;
- }
- .card, .card-body {
- border-radius: .25rem
- }
- .login-btn {
- padding-left: 2rem!important;;
- padding-right: 1.5rem!important;
- }
- .content {
- overflow-x: hidden;
- }
- .form-group .control-label {
- text-align: left;
- }
- .justify-content-between {
- margin-top: 1rem;
- }
- #captcha {
- width: 185px;
- float: left;
- }
- .captcha-img {
- float: right;
- width: 110px;
- height: 34px;
- }
- </style>
- <div class="login-page bg-40">
- <div class="login-box">
- <div class="login-logo mb-2">
- {{ trans('admin.site_name') }}
- </div>
- <div class="card">
- <div class="card-body login-card-body shadow-100">
- {{-- <p class="login-box-msg mt-1 mb-1">{{ __('admin.welcome_back') }}</p>--}}
- <form id="login-form" method="POST" action="{{ admin_url('auth/login') }}">
- <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
- <fieldset class="form-label-group form-group position-relative has-icon-left">
- <input
- type="text"
- class="form-control {{ $errors->has('username') ? 'is-invalid' : '' }}"
- name="username"
- placeholder="{{ trans('admin.username') }}"
- value="{{ old('username') }}"
- required
- autofocus
- >
- <div class="form-control-position">
- <i class="feather icon-user"></i>
- </div>
- <label for="email">{{ trans('admin.username') }}</label>
- <div class="help-block with-errors"></div>
- @if($errors->has('username'))
- <span class="invalid-feedback text-danger" role="alert">
- @foreach($errors->get('username') as $message)
- <span class="control-label" for="inputError"><i class="feather icon-x-circle"></i> {{$message}}</span><br>
- @endforeach
- </span>
- @endif
- </fieldset>
- <fieldset class="form-label-group form-group position-relative has-icon-left">
- <input
- minlength="5"
- maxlength="20"
- id="password"
- type="password"
- class="form-control {{ $errors->has('password') ? 'is-invalid' : '' }}"
- name="password"
- placeholder="{{ trans('admin.password') }}"
- required
- autocomplete="current-password"
- >
- <div class="form-control-position">
- <i class="feather icon-lock"></i>
- </div>
- <label for="password">{{ trans('admin.password') }}</label>
- <div class="help-block with-errors"></div>
- @if($errors->has('password'))
- <span class="invalid-feedback text-danger" role="alert">
- @foreach($errors->get('password') as $message)
- <span class="control-label" for="inputError"><i class="feather icon-x-circle"></i> {{$message}}</span><br>
- @endforeach
- </span>
- @endif
- </fieldset>
- <fieldset class="form-label-group form-group position-relative has-icon-left">
- <input
- minlength="6"
- maxlength="6"
- id="captcha"
- type="captcha"
- class="form-control"
- name="captcha"
- placeholder="{{ trans('admin.captcha') }}"
- required
- >
- <img src="/prime-control/captcha?{{ time() }}" alt="captcha" class="captcha-img" onclick="this.src='/prime-control/captcha?'+Math.random()">
- <div class="form-control-position">
- <i class="feather icon-image"></i>
- </div>
- <label for="captcha">{{ trans('admin.captcha') }}</label>
- <div class="help-block with-errors"></div>
- @if($errors->has('captcha'))
- <span class="invalid-feedback text-danger" role="alert">
- @foreach($errors->get('captcha') as $message)
- <span class="control-label" for="inputError"><i class="feather icon-x-circle"></i> {{$message}}</span><br>
- @endforeach
- </span>
- @endif
- </fieldset>
- {{-- <div class="form-group d-flex justify-content-between align-items-center">--}}
- {{-- <div class="text-left">--}}
- {{-- <a class="lang-item" href="javascript:void(0);" data-lang="en">English</a>--}}
- {{-- / <a class="lang-item" href="javascript:void(0);" data-lang="zh_CN">中文</a>--}}
- {{-- </div>--}}
- {{-- </div>--}}
- <button type="submit" class="btn btn-primary float-letf login-btn">
- {{ __('admin.login') }}
- <i class="feather icon-arrow-right"></i>
- </button>
- <div class="form-group d-flex justify-content-between align-items-center">
- <div class="text-left">
- @if(config('admin.auth.remember'))
- <fieldset class="checkbox">
- <div class="vs-checkbox-con vs-checkbox-primary">
- <input id="remember" name="remember" value="1" type="checkbox" {{ old('remember') ? 'checked' : '' }}>
- <span class="vs-checkbox">
- <span class="vs-checkbox--check">
- <i class="vs-icon feather icon-check"></i>
- </span>
- </span>
- <span> {{ trans('admin.remember_me') }}</span>
- </div>
- </fieldset>
- @endif
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- <script>
- Dcat.ready(function () {
- // ajax表单提交
- $('#login-form').form({
- validate: true,
- });
- });
- </script>
- <script>
- document.querySelectorAll('.lang-item').forEach(item => {
- item.addEventListener('click', function() {
- const lang = this.getAttribute('data-lang');
- switchLanguage(lang);
- });
- });
- function switchLanguage(lang) {
- fetch(`/prime-control/language-switch?lang=${encodeURIComponent(lang)}`, {
- method: 'GET'
- })
- .then(response => {
- if (!response.ok) {
- throw new Error('Network response was not ok');
- }
- return response.json();
- })
- .then(data => {
- if (data.success) {
- window.location.reload();
- } else {
- throw new Error(data.error || 'Language switch failed');
- }
- })
- .catch(error => {
- console.error('Language Switch Error:', error);
- alert('Failed to switch language. Please try again.');
- });
- }
- </script>
|