<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<link rel="icon" href="{{ inject('setting')->config('brand_ico') }}" type="image/x-icon">
<title>{{ inject('setting')->config('brand_name') }}后台登录</title>
<link rel="stylesheet" href="{{ config('system.icon_url') }}">
<link rel="stylesheet" href="{{ asset('data/assets/css/app.css') }}">
<script>    
    if (top.location != self.location) {
        top.location = "{{ url('login') }}";
    }
</script>
</head>
<body style="overflow: hidden;background-color: rgb(11, 65, 130);">
    <div class="container" id="login-view">
        <div class="login-box">
            <h3 class="logo-box" style="background: url({{ inject('setting')->config('brand_login_logo') }}) 31% 50% no-repeat;">
                {{ inject('setting')->config('brand_name') }}
            </h3>
            <form method="post" autocomplete="off">
                {!! csrf_field() !!}
                <div class="form-group input-outer">
                    <i class="iconfont icon-yonghu"></i>
                    <input type="text" class="text login-input-placeholder" name="username" placeholder="账号/邮箱" required autocomplete="off">
                </div>
                <div class="form-group input-outer">
                    <i class="iconfont icon-mima"></i>
                    <input type="password" class="text login-input-placeholder" name="password" value placeholder="密码" required autocomplete="off">
                </div>
                @foreach ($errors->all() as $error)
                <div class="errors-text">
                    <div class="alert alert-danger" role="alert">
                        <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
                        <span class="sr-only">Error:</span>
                        {{ $error }}
                    </div>
                </div>
                @endforeach
                @if($errors->login->first('email'))
                <div class="errors-text">
                    <div class="alert alert-danger" role="alert">
                        <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
                        <span class="sr-only">Error:</span>
                        {{ $errors->login->first('email') }}
                    </div>
                </div>
                @endif
                @if (Session::has('error'))
                    <div class="errors-text">
                        <div class="alert alert-danger" role="alert">
                            <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
                            <span class="sr-only">Error:</span>
                            {!! Session::get('error') !!}
                        </div>
                    </div>
                @endif
                <button class="btn btn-block btn-login mt-40" type="submit">登  录</button>
            </form>
        </div>
        <div class="login-footer text-center">
            Copyright © 2024
            <a href="{{ inject('setting')->config('brand_url') }}" target="_blank">{{ inject('setting')->config('brand_copyright_name') }}</a>
            {{ config('setting.version') }} <a href="{{ url('/') }}" target="_blank">返回首页</a>
        </div>
    </div>
</body>

<script>
    var view = document.getElementById("login-view");
    view.style.height = document.documentElement.clientHeight + 'px';
    window.onresize = function(){
        view.style.height = document.documentElement.clientHeight + 'px';
    }
</script>
</html>
