<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>后台登陆</title>
    <link rel="icon" type="image/x-icon" href="https://oss.tcjskd.com/delivery/upload/web/img/logo1.png">
    <link href="https://oss.tcjskd.com/delivery/upload/css/bootstrap3.3.7.min.css" rel="stylesheet">
    <link href="https://oss.tcjskd.com/delivery/upload/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="https://oss.tcjskd.com/delivery/upload/css/style.min.css" rel="stylesheet">
    <!--对话框-->
    <link href="https://oss.tcjskd.com/delivery/upload/css/animate.css" rel="stylesheet">
    <link href="https://oss.tcjskd.com/delivery/upload/css/style.min.css" rel="stylesheet">
    <link href="https://oss.tcjskd.com/delivery/upload/css/fontawesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://oss.tcjskd.com/delivery/upload/css/drag.css">
    <style>
        body{
            background:url(https://oss.tcjskd.com/delivery/upload/images/login-bg2.jpg)  no-repeat center center;
            background-size:cover;
            background-attachment:fixed;
            background-color:#CCCCCC;
        }
        .lyear-wrapper {
            position: relative;
        }
        .lyear-login {
            display: flex !important;
            min-height: 100vh;
            align-items: center !important;
            justify-content: center !important;
        }
        .login-center {
            background: #fff;
            min-width: 38.25rem;
            padding: 2.14286em 3.57143em;
            border-radius: 5px;
            margin: 2.85714em 0;
        }
        .login-header {
            margin-bottom: 1.5rem !important;
        }
        .login-center .has-feedback.feedback-left .form-control {
            padding-left: 38px;
            padding-right: 12px;
        }
        .login-center .has-feedback.feedback-left .form-control-feedback {
            left: 0;
            right: auto;
            width: 38px;
            height: 38px;
            line-height: 38px;
            z-index: 4;
            color: #dcdcdc;
        }
        .login-center .has-feedback.feedback-left.row .form-control-feedback {
            left: 15px;
        }
    </style>
</head>
<style>
    .imgBtn img{
        width:100%
    }
    .slidetounlock{
        font-size: 12px;
        background:-webkit-gradient(linear,left top,right top,color-stop(0,#4d4d4d),color-stop(.4,#4d4d4d),color-stop(.5,#fff),color-stop(.6,#4d4d4d),color-stop(1,#4d4d4d));
        -webkit-background-clip:text;
        -webkit-text-fill-color:transparent;
        -webkit-animation:slidetounlock 3s infinite;
        -webkit-text-size-adjust:none
    }
    @-webkit-keyframes slidetounlock{0%{background-position:-200px 0} 100%{background-position:200px 0}}

</style>

<body>
<div class="row lyear-wrapper">
    <div class="lyear-login">
        <div class="login-center">
            <div class="login-header text-center">
                <!--<a href="javascript:void(0);"> <img alt="light year admin" src="https://oss.tcjskd.com/delivery/upload/images/admin.png"> </a>-->
                <p style="font-size: large;color: #52d3c7">${config_project_name.configValue!}</p>
            </div>
            <form action="#!" method="post">
                <div class="form-group has-feedback feedback-left">
                    <input type="text" placeholder="请输入您的账号" class="form-control" name="username" id="username" required="required" />
                    <span class="mdi mdi-account form-control-feedback" aria-hidden="true"></span>
                </div>
                <div class="form-group has-feedback feedback-left">
                    <input type="password" placeholder="请输入密码" class="form-control" id="password" name="password" />
                    <span class="mdi mdi-lock form-control-feedback" aria-hidden="true"></span>
                </div>
                <div class="form-group has-feedback feedback-left">
                    <div id="wrapper">
                        <div id="drag">
                            <div class="drag_bg"></div>
                            <div class="drag_text slidetounlock" onselectstart="return false;" unselectable="on">
                                请按住滑块，拖动到最右边
                            </div>
                            <div class="handler handler_bg"></div>
                        </div>
                    </div>

                </div>
                    <!--滑块验证码，结束-->
                <div class="form-group" style="margin-top: 20px;">
                    <button class="btn btn-block btn-primary" type="button" onclick="loginValidate()">立即登录</button>
                </div>
            </form>
            <hr>
            <footer class="col-sm-12 text-center">
                <p class="m-b-0">Copyright © 2019 <a href="https://www.tcjskd.com/" target="_blank">同城急送</a>. All right reserved</p>
            </footer>
        </div>
    </div>
</div>
<script type="text/javascript" src="https://oss.tcjskd.com/delivery/upload/js/jquery.min.js"></script>
<script type="text/javascript" src="https://oss.tcjskd.com/delivery/upload/js/bootstrap.min.js"></script>
<!--消息提示-->
<script src="https://oss.tcjskd.com/delivery/upload/js/bootstrap-notify.min.js"></script>
<script type="text/javascript" src="https://oss.tcjskd.com/delivery/upload/js/lightyear.js"></script>
<script src="https://oss.tcjskd.com/delivery/upload/js/drag.js"></script>
<script type="text/javascript">
    var result=false;
    function loginValidate(){
        var username=$("#username").val();
        var password=$("#password").val();
        if (username.length == 0){
            lightyear.notify("您还没有输入账号！", 'danger');
            return;
        }
        if(password.length == 0){
            lightyear.notify("您还没有输入密码！", 'danger');
            return;
        }
        if (!result){
            lightyear.notify("验证码校验未通过！", 'danger');
            return;
        }
        $.ajax({
            type:"POST",
            url:" ${ctx}/login/login?"+"username="+username+"&password="+password,
            dataType:"json",
            success:function(data){
                if(data.status!=200){
                    lightyear.notify(data.message, 'danger');
                }else{
                    window.location.href="${ctx}"+data.body;
                    return;
                }
            },
            error:function(jqXHR){
                lightyear.notify("您真牛，服务器都懵逼了......", 'danger');
                console.log("Error: "+jqXHR.status);
            }
        });
    }
</script>
<script>

    $('#drag').drag({},function (x) {
        result=true;
        console.log("success");
    });
</script>
</body>
</html>