<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>认证页面</title>
    <link rel="shortcut icon" href="//x.autoimg.cn/jiage/carprice/pc/img/bulebj32X32.ico"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <link rel="stylesheet" href="/metrics/css/layui.css">
<!--    <link rel="stylesheet" href="https://www.layuicdn.com/layui/css/layui.css">-->
    <script src="/metrics/jquery.js"></script>

    <style type="text/css">
        .container {
            width: 420px;
            height: 320px;
            min-height: 320px;
            max-height: 320px;
            position: absolute;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            margin: auto;
            padding: 20px;
            z-index: 130;
            border-radius: 8px;
            background-color: #fff;
            box-shadow: 0 3px 18px rgba(100, 0, 0, .5);
            font-size: 16px;
        }

        .close {
            background-color: white;
            border: none;
            font-size: 18px;
            margin-left: 410px;
            margin-top: -10px;
        }

        .layui-input {
            border-radius: 5px;
            width: 300px;
            height: 40px;
            font-size: 15px;
        }

        .layui-form-item {
            margin-left: -20px;
        }

        #logoid {
            margin-top: -16px;
            padding-left: 150px;
            padding-bottom: 15px;
        }

        .layui-btn {
            margin-left: -50px;
            border-radius: 5px;
            width: 350px;
            height: 40px;
            font-size: 15px;
        }

        .verity {
            width: 120px;
        }

        .font-set {
            font-size: 13px;
            text-decoration: none;
            margin-left: 120px;
        }

        a:hover {
            text-decoration: underline;
        }

        .box2 {
            width: 100px;
            height: 100px;
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            right: 0;
            margin: auto;
        }

    </style>
</head>
<body>
<form class="layui-form" action="" method="post">
    <div class="container ">
        <div>
            <div style="height: 80px"></div>
            <div class="layui-form-item"></div>
            <div class="layui-form-item">
                <label class="layui-form-label">用户名</label>
                <div class="layui-input-block">
                    <input type="username" name="username" required lay-verify="required" placeholder="请输入用户名"
                           autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">密码</label>
                <div class="layui-input-block">
                    <input type="password" name="token" required lay-verify="required" placeholder="请输入管理口令"
                           autocomplete="off" class="layui-input">
                </div>
            </div>
            <div style="height: 30px"></div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="login">登录</button>
                </div>
            </div>
        </div>
    </div>
</form>
<script src="/metrics/layui.js?v=20241120003"></script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer1 = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;


        //监听提交
        form.on('submit(login)', function (data) {
            var d = data.field;
            $.ajax({
                url: '/mis/toLogin',
                data: d,
                dataType: 'text',
                success:function (data) {
                    if (data == '1'){
                        location.href='/mis/index';
                    }else {
                        layer.alert("用户名或密码错误");
                    }
                }
            });
            return false
        });


    });
</script>
</body>
