<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <link rel="shortcut icon" th:href="@{/images/logo.jpg}">
    <link rel="stylesheet" th:href="@{/css/font.css}">
    <link rel="stylesheet" th:href="@{/css/xadmin.css}">
    <script type="text/javascript" th:src="@{/js/jquery-3.3.1.min.js}"></script>
    <script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
    <script type="text/javascript" th:src="@{/js/xadmin.js}"></script>
    <script type="text/javascript" th:src="@{/js/md5.js}"></script>

</head>
<body>
<div class="x-body layui-anim layui-anim-up">

    <div class="layui-elem-quote" style="display: flex;justify-content: space-between;align-items: center">
        <div>
            欢迎：
            <span class="x-red" th:text="${admin.adminName}"></span>！当前时间:&nbsp;&nbsp;<span id="now"
                                                                                            style="color:#029688"></span>
        </div>
        <div>
            <a class="layui-btn layui-btn-small" href="javascript:location.replace(location.href);" title="刷新">
                <i class="layui-icon">ဂ</i></a>
        </div>
    </div>
</div>
<script>
    function run() {
        var time = new Date();//获取系统当前时间
        var year = time.getFullYear();
        var month = time.getMonth() + 1;
        var date = time.getDate();//系统时间月份中的日
        var day = time.getDay();//系统时间中的星期值
        var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
        var week = weeks[day];//显示为星期几
        var hour = time.getHours();
        var minutes = time.getMinutes();
        var seconds = time.getSeconds();
        if (month < 10) {
            month = "0" + month;
        }
        if (date < 10) {
            date = "0" + date;
        }
        if (hour < 10) {
            hour = "0" + hour;
        }
        if (minutes < 10) {
            minutes = "0" + minutes;
        }
        if (seconds < 10) {
            seconds = "0" + seconds;
        }
        //var newDate = year+"年"+month+"月"+date+"日"+week+hour+":"+minutes+":"+seconds;
        var now = year + "年" + month + "月" + date + "日" + week + hour + ":" + minutes + ":" + seconds;
        $("#now").html(now);
        setTimeout('run()', 1000);
    }

    $(function () {
        run();
    })
</script>
</body>
</html>