From 8bc69dccd6683a7bf13bfbcfffd8fec9bd688887 Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期五, 20 三月 2026 20:25:20 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/login.html |  953 +++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 760 insertions(+), 193 deletions(-)

diff --git a/src/main/webapp/views/login.html b/src/main/webapp/views/login.html
index d8442c9..b89c4c4 100644
--- a/src/main/webapp/views/login.html
+++ b/src/main/webapp/views/login.html
@@ -1,227 +1,794 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-    <meta charset="UTF-8">
-    <title>绯荤粺鐧诲綍</title>
-    <link rel="stylesheet" href="../static/layui/css/layui.css" media="all">
-    <script type="text/javascript" src="../static/layui/layui.js"></script>
-    <script type="text/javascript" src="../static/js/common.js"></script>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <title>WMS</title>
+    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1">
+    <meta name="description" content="study of Instancing with three.js">
+    <meta name="keywords" content="undefined, Yoichi Kobayashi, WebGL, three.js">
+    <meta name="theme-color" content="#111111">
+    <meta name="msapplication-TileImage" content="/sketch-threejs/img/common/ms_tileimage.png">
+    <meta name="msapplication-TileColor" content="#111111">
+    <link rel="icon" type="image/x-icon" href="../static/image/favicon.ico"/>
+    <link rel="stylesheet" href="../static/css/font/font-awesome-4.7.0/css/font-awesome.css">
+    <link rel="stylesheet" href="../static/css/main.min.css">
+    <link rel="stylesheet" href="../static/css/login.css">
     <style>
-        html{
-            height: 100%;
-        }
-        body.login-bg {
-            color: #777;
-            height: 100%;
-            /*background-image: url("../static/image/bg-imgage.jpg");*/
-            background-image: url("../static/image/login_bg.jpg");
-            background-repeat: no-repeat;
-            background-size: cover;
-            background-position: top center;
-        }
-
-        #login-wrapper {
-            /*color: #fff;*/
-            box-sizing:border-box;
-            /*background: #576669;*/
-            background: #fff;
+        #sidebar {
+            /*瀹氫綅*/
             position: absolute;
-            top: 45%;
-            left: 50%;
-            margin-top: -210px;
-            margin-left: -220px;
-            width: 440px;
-            min-height: 420px;
-            padding: 50px;
-            text-align: center;
+            top: 50%;
+            right: 1%;
+            transform: translateY(-50%);
+            width: 20%;
+            height: 95%;
+            /*鐗规晥*/
+            background: rgba(255, 255, 255, 0.6);
             border-radius: 5px;
-
-            transform-origin: 50% 50%;
-            animation: loading 1s 0s forwards;
-            transform: rotateX(0deg);
+            color: #ffffff;
+            z-index: 99;
+            box-shadow: 3px 3px 6px 3px rgba(0, 0, 0, .3);
         }
 
-        #login-wrapper h2 {
-            font-size: 26px;
-            margin-bottom: 30px;
-        }
-
-        .layadmin-user-login-body .layui-form-item {
-            margin-bottom: 20px;
+        .login-contain {
             position: relative;
+            width: 100%;
+            height: 100%;
         }
-        .layadmin-user-login-body .layui-form-item .layui-input {
-            height: 42px;
-            padding-left: 40px;
-            font-size: 16px;
-            border: 1px solid #c8cccf;
-            color: inherit;
-        }
-        .login-submit {
-            margin-top: 30px;
-        }
-        .layadmin-user-login-icon {
+
+        .login-box {
             position: absolute;
-            left: 1px;
-            top: 1px;
-            width: 38px;
-            line-height: 40px;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+            width: 100%;
             text-align: center;
-            color: #B2B2B2;
+        }
+
+        .license-entry-text {
+            width: 80%;
+            margin: 0 auto 12px;
+            color: #5e5e5e;
+            font-size: 12px;
+            line-height: 1.7;
+            text-align: left;
+        }
+
+        .system-tool-shell {
+            background: #ffffff;
+            border-radius: 22px;
+            overflow: hidden;
+        }
+
+        .system-tool-header {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            padding: 14px 20px;
+            border-bottom: 1px solid #dbe4ef;
+        }
+
+        .system-tool-title {
+            color: #243447;
             font-size: 18px;
+            font-weight: 700;
         }
-        .layui-btn-normal {
-            background-color: #0767aa;
-            font-size: 20px;
+
+        .system-tool-close {
+            color: #97a5b4;
+            font-size: 24px;
+            line-height: 1;
+            cursor: pointer;
+            user-select: none;
+        }
+
+        .system-tool-body {
+            padding: 18px 20px 22px;
+            background: #ffffff;
+        }
+
+        .system-tool-group + .system-tool-group {
+            margin-top: 18px;
+            padding-top: 18px;
+            border-top: 1px solid #e8eef5;
+        }
+
+        .system-tool-group-title {
+            color: #34495e;
+            font-size: 14px;
+            font-weight: 700;
+            margin-bottom: 14px;
+        }
+
+        .system-tool-actions {
+            display: flex;
+            flex-wrap: wrap;
+            gap: 12px 18px;
+        }
+
+        .system-tool-btn {
+            min-width: 104px;
+            height: 34px;
+            padding: 0 18px;
+            border: 1px solid #d7dfea;
             border-radius: 4px;
-            height: 52px;
+            background: #ffffff;
+            color: #4d5d6d;
+            font-size: 14px;
+            cursor: pointer;
+            box-sizing: border-box;
         }
-        #code-box {
-            position: relative;
-            height: 42px;
+
+        .system-tool-btn.primary {
+            color: #ffffff;
+            background: #5da8ff;
+            border-color: #5da8ff;
         }
-        #code-label {
-            z-index: 999;
+
+        .system-tool-btn.secondary {
+            color: #7eb4ef;
+            background: #d9ecff;
+            border-color: #aed4ff;
         }
-        #code {
-            position: absolute;
-            left: 0;
-            top: 0;
-            display: inline-block;
-            width: 60%;
+
+        .system-tool-desc {
+            margin-top: 12px;
+            color: #9aa8b6;
+            font-size: 12px;
+            line-height: 1.7;
         }
-        #codeImg {
-            border: 1px solid rgba(0,0,0,0.1);
-            position: absolute;
-            right: 5%;
-            top: 0;
-            width: 30%;
-            height: 90%;
+
+        .system-dialog-shell {
+            background: #ffffff;
+            border-radius: 18px;
+            overflow: hidden;
         }
+
+        .system-dialog-header {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            padding: 14px 18px;
+            border-bottom: 1px solid #e1e8f0;
+            background: #f8fbff;
+        }
+
+        .system-dialog-title {
+            color: #243447;
+            font-size: 16px;
+            font-weight: 700;
+        }
+
+        .system-dialog-close {
+            color: #97a5b4;
+            font-size: 22px;
+            line-height: 1;
+            cursor: pointer;
+            user-select: none;
+        }
+
+        .system-dialog-body {
+            padding: 18px;
+            background: #ffffff;
+        }
+
+        .system-dialog-label {
+            color: #43576b;
+            font-size: 13px;
+            font-weight: 700;
+            margin-bottom: 8px;
+        }
+
+        .system-dialog-tip {
+            margin-bottom: 10px;
+            color: #8c9aac;
+            font-size: 12px;
+            line-height: 1.7;
+        }
+
+        .system-dialog-textarea {
+            width: 100%;
+            min-height: 220px;
+            resize: none;
+            border: 1px solid #d7dfea;
+            border-radius: 8px;
+            padding: 10px 12px;
+            box-sizing: border-box;
+            color: #4d5d6d;
+            background: #fbfdff;
+            font-size: 13px;
+            line-height: 1.7;
+        }
+
+        .system-dialog-footer {
+            display: flex;
+            justify-content: flex-end;
+            gap: 10px;
+            margin-top: 14px;
+        }
+
+        body .system-tool-popup {
+            border-radius: 22px !important;
+            overflow: hidden !important;
+        }
+
+        body .system-tool-popup .layui-layer-content {
+            overflow: hidden !important;
+            background: transparent;
+        }
+
     </style>
 </head>
-<body class="login-bg">
-
-<div id="login-wrapper">
-    <header>
-        <h2>绯荤粺鐧诲綍</h2>
-    </header>
-    <div class="layui-form layadmin-user-login-body">
-        <div class="layui-form-item">
-            <label class="layui-icon layui-icon-cellphone layadmin-user-login-icon"></label>
-            <input id="mobile" class="layui-input" type="text" name="mobile" lay-verify="mobile" placeholder="鐢ㄦ埛鍚�">
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-icon layui-icon-password layadmin-user-login-icon"></label>
-            <input id="password" class="layui-input" type="password" name="password" lay-verify="password" placeholder="瀵嗙爜">
-        </div>
-        <div id="code-box" class="layui-form-item" style="">
-            <label id="code-label" class="layui-icon layui-icon-vercode layadmin-user-login-icon"></label>
-            <input id="code" class="layui-input" type="text" name="password" lay-verify="code" placeholder="楠岃瘉鐮�">
-            <img id="codeImg" title="鐪嬩笉娓咃紵鐐瑰嚮鎹竴寮犮��">
-        </div>
-        <!--<div class="layui-form-item">-->
-            <!--<input id="rememberPwd" style="vertical-align: middle" type="checkbox" lay-filter="remPwd" lay-skin="switch" lay-text="寮�鍚瘄鍏抽棴" title="璁颁綇瀵嗙爜" checked="checked">-->
-            <!--<span style="vertical-align: middle;font-size: 15px">璁颁綇瀵嗙爜</span>-->
-        <!--</div>-->
+<body>
+<div class="l-page l-page--white" data-id="instancing">
+    <div style="position: fixed;
+                    z-index: 100;
+                    top: 22px;
+                    left: 20px;">
+        <img src="../static/image/logo_light_colour.png" alt="" style="width: 20%">
     </div>
-    <div class="layui-form-item login-submit">
-        <button id="login-button" class="layui-btn layui-btn-fluid layui-btn-normal" lay-submit="" lay-filter="login">鐧� 褰�</button>
+    <div class="p-sketch-outline">
+        <h2 class="p-sketch-outline__title">Automatic Storage and Retrieval System</h2>
+        <p class="p-sketch-outline__date">posted: 2018.01.01 / update: 2022.09.21
+        </p>
+        <p class="p-sketch-outline__description">wms made with various simple objects.</p>
+    </div>
+    <canvas class="p-canvas-webgl" id="canvas-webgl"></canvas>
+</div>
+<!-- 渚ц竟鏍� -->
+<div id="sidebar">
+    <div class="login-contain">
+        <div class="login-box">
+            <img src="../static/image/zy_logo_dark_color.png" alt="" style="width: 80%">
+            <!--          <span class="login100-form-title p-t-20 p-b-45">涓壃绔嬪簱</span>-->
+            <!--          <span class="login100-form-title p-t-20 p-b-45" style="margin: 15px 0;color: #868686;font-size: 24px">WMS</span>-->
+            <div class="wrap-input100 validate-input m-b-10" data-validate="璇疯緭鍏ョ敤鎴峰悕">
+                <input id="username" class="input100" type="text" name="username" placeholder="username"
+                       autocomplete="off">
+                <span class="focus-input100"></span>
+                <span class="symbol-input100">
+              <i class="fa fa-user"></i>
+            </span>
+            </div>
+            <div class="wrap-input100 validate-input m-b-10" data-validate="璇疯緭鍏ュ瘑鐮�">
+                <input id="password" class="input100" type="password" name="pass" placeholder="password">
+                <span class="focus-input100"></span>
+                <span class="symbol-input100">
+              <i class="fa fa-lock"></i>
+            </span>
+            </div>
+            <div class="container-login100-form-btn p-t-10">
+                <button class="login100-form-btn login-btn">Login</button>
+            </div>
+            <div class="container-login100-form-btn p-t-10" style="display: none;margin-top: 50px;" id="updateLicense">
+                <div class="license-entry-text" id="licenseEntryMessage">绯荤粺褰撳墠鏈娴嬪埌鍙敤璁稿彲璇侊紝璇锋墦寮�绯荤粺宸ュ叿澶勭悊璁稿彲璇併��</div>
+                <button class="login100-form-btn" id="openLicenseTool" type="button">绯荤粺宸ュ叿</button>
+            </div>
+        </div>
     </div>
 </div>
 
-</body>
+<script type="text/javascript" src="../static/js/tools/main.min.js"></script>
 <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
 <script type="text/javascript" src="../static/js/tools/md5.js"></script>
-<script type="text/javascript">
+<script type="text/javascript" src="../static/layer/layer.js"></script>
+<script type="text/javascript" src="../static/js/common.js"></script>
+<script>
+    // remember pwd
+    $(function () {
+        var oldUserName = localStorage.getItem('oldUserName');
+        var oldPass = localStorage.getItem('oldPass');
+        if (oldUserName) {
+            $('#username').val(oldUserName);
+        }
+        if (oldPass) {
+            $('#password').val(oldPass);
+        }
+        autoShowLicenseTool();
+    })
 
-    // 楠岃瘉鐮佸紑鍏�
-    var codeSwitch = 'Y';
-    $.ajax({
-        url: baseUrl+"/code/switch.action",
-        async: false,
-        success: function (res) {
-            if (res.data === 'N'){
-                codeSwitch = res.data;
-                $('#code-box').css("display", "none");
+    window.onload = function () {
+        document.getElementById("username").focus();
+    }
+
+    var licenseToolState = {
+        toolLayerIndex: null,
+        textLayerIndex: null,
+        uploadLayerIndex: null
+    };
+
+    function getQueryValue(name) {
+        var query = window.location.search.substring(1).split("&");
+        for (var i = 0; i < query.length; i++) {
+            var item = query[i].split("=");
+            if (item[0] === name) {
+                return decodeURIComponent(item[1] || "");
             }
+        }
+        return "";
+    }
+
+    function autoShowLicenseTool() {
+        var needOpen = getQueryValue("license") === "invalid" || sessionStorage.getItem("licensePanelAutoOpen") === "1";
+        if (!needOpen) {
+            return;
+        }
+        verifyLicenseAvailability(function (isValid) {
+            if (isValid) {
+                clearLicensePromptState();
+                hideLicenseEntry();
+                clearLicenseQueryFlag();
+                return;
+            }
+            var message = sessionStorage.getItem("licenseInvalidReason") || "绯荤粺褰撳墠鏈娴嬪埌鍙敤璁稿彲璇侊紝璇峰厛瀵煎叆鏂扮殑璁稿彲璇併��";
+            showLicenseEntry(message);
+            openLicenseTool(message);
+        });
+    }
+
+    function showLicenseEntry(message) {
+        $("#updateLicense").show();
+        if (message) {
+            $("#licenseEntryMessage").text(message);
+        }
+    }
+
+    function hideLicenseEntry() {
+        $("#updateLicense").hide();
+    }
+
+    function clearLicensePromptState() {
+        sessionStorage.removeItem("licensePanelAutoOpen");
+        sessionStorage.removeItem("licenseInvalidReason");
+    }
+
+    function clearLicenseQueryFlag() {
+        if (window.history && window.history.replaceState && getQueryValue("license") === "invalid") {
+            window.history.replaceState(null, document.title, window.location.pathname);
+        }
+    }
+
+    function verifyLicenseAvailability(callback) {
+        $.ajax({
+            url: baseUrl + "/license/getLicenseDays",
+            method: 'GET',
+            success: function (res) {
+                if (res.code == 200) {
+                    var days = Number(getResponseValue(res));
+                    callback(!isNaN(days) && days >= 0);
+                    return;
+                }
+                callback(false);
+            },
+            error: function () {
+                callback(false);
+            }
+        });
+    }
+
+    function escapeHtml(text) {
+        return String(text || "")
+            .replace(/&/g, "&amp;")
+            .replace(/</g, "&lt;")
+            .replace(/>/g, "&gt;")
+            .replace(/\"/g, "&quot;")
+            .replace(/'/g, "&#39;");
+    }
+
+    function buildLicenseToolContent() {
+        return ''
+            + '<div class="system-tool-shell">'
+            + '  <div class="system-tool-header">'
+            + '    <div class="system-tool-title">绯荤粺宸ュ叿</div>'
+            + '    <span class="system-tool-close" id="toolClose">脳</span>'
+            + '  </div>'
+            + '  <div class="system-tool-body">'
+            + '    <div class="system-tool-group">'
+            + '      <div class="system-tool-group-title">鎺ㄨ崘鎿嶄綔</div>'
+            + '      <div class="system-tool-actions">'
+            + '        <button type="button" class="system-tool-btn primary" id="toolRequestCode">鑾峰彇璇锋眰鐮�</button>'
+            + '        <button type="button" class="system-tool-btn secondary" id="toolActivate">涓�閿縺娲�</button>'
+            + '      </div>'
+            + '      <div class="system-tool-desc">浼樺厛浣跨敤鈥滆幏鍙栬姹傜爜鈥濆拰鈥滀竴閿縺娲烩�濆畬鎴愯鍙瘉鐢宠涓庢縺娲汇��</div>'
+            + '    </div>'
+            + '    <div class="system-tool-group">'
+            + '      <div class="system-tool-group-title">鍏朵粬宸ュ叿</div>'
+            + '      <div class="system-tool-actions">'
+            + '        <button type="button" class="system-tool-btn" id="toolProjectName">鑾峰彇椤圭洰鍚嶇О</button>'
+            + '        <button type="button" class="system-tool-btn" id="toolServerInfo">鑾峰彇绯荤粺閰嶇疆</button>'
+            + '        <button type="button" class="system-tool-btn" id="toolInputLicense">褰曞叆璁稿彲璇�</button>'
+            + '      </div>'
+            + '    </div>'
+            + '  </div>'
+            + '</div>';
+    }
+
+    function openLicenseTool(message) {
+        var toolMessage = message || $("#licenseEntryMessage").text() || "绯荤粺褰撳墠鏈娴嬪埌鍙敤璁稿彲璇侊紝璇峰厛瀵煎叆鏂扮殑璁稿彲璇併��";
+        var toolWidth = Math.min($(window).width() - 32, 760);
+        showLicenseEntry(toolMessage);
+        if (licenseToolState.toolLayerIndex !== null) {
+            layer.close(licenseToolState.toolLayerIndex);
+        }
+        licenseToolState.toolLayerIndex = layer.open({
+            type: 1,
+            title: false,
+            closeBtn: 0,
+            area: [Math.min(toolWidth, 560) + 'px', 'auto'],
+            shadeClose: false,
+            skin: 'system-tool-popup',
+            content: buildLicenseToolContent(),
+            success: function (layero, index) {
+                licenseToolState.toolLayerIndex = index;
+                bindLicenseToolEvents(layero);
+            },
+            end: function () {
+                licenseToolState.toolLayerIndex = null;
+            }
+        });
+    }
+
+    function bindLicenseToolEvents(layero) {
+        layero.find("#toolClose").on("click", function () {
+            layer.close(licenseToolState.toolLayerIndex);
+        });
+        layero.find("#toolRequestCode").on("click", function () {
+            requestCode();
+        });
+        layero.find("#toolActivate").on("click", function () {
+            activateLicense();
+        });
+        layero.find("#toolProjectName").on("click", function () {
+            getProjectName();
+        });
+        layero.find("#toolServerInfo").on("click", function () {
+            getServerInfo();
+        });
+        layero.find("#toolInputLicense").on("click", function () {
+            openLicenseInputDialog();
+        });
+    }
+
+    function getResponseValue(res) {
+        if (!res) {
+            return "";
+        }
+        if (typeof res.data !== "undefined" && res.data !== null && res.data !== "") {
+            return res.data;
+        }
+        if (typeof res.msg !== "undefined" && res.msg !== null && res.msg !== "") {
+            return res.msg;
+        }
+        return "";
+    }
+
+    function openTextDialog(title, label, text, tip) {
+        var prettyText = "";
+        try {
+            prettyText = typeof text === "string" ? text : JSON.stringify(text, null, 2);
+        } catch (e) {
+            prettyText = String(text || "");
+        }
+        if (licenseToolState.textLayerIndex !== null) {
+            layer.close(licenseToolState.textLayerIndex);
+        }
+        licenseToolState.textLayerIndex = layer.open({
+            type: 1,
+            title: false,
+            closeBtn: 0,
+            area: [Math.min($(window).width() - 32, 720) + 'px', 'auto'],
+            shadeClose: false,
+            skin: 'system-tool-popup',
+            content: ''
+                + '<div class="system-dialog-shell">'
+                + '  <div class="system-dialog-header">'
+                + '    <div class="system-dialog-title">' + escapeHtml(title) + '</div>'
+                + '    <span class="system-dialog-close" id="systemTextClose">脳</span>'
+                + '  </div>'
+                + '  <div class="system-dialog-body">'
+                + '    <div class="system-dialog-label">' + escapeHtml(label) + '</div>'
+                + (tip ? '<div class="system-dialog-tip">' + escapeHtml(tip) + '</div>' : '')
+                + '    <textarea class="system-dialog-textarea" id="systemDialogText" readonly></textarea>'
+                + '    <div class="system-dialog-footer">'
+                + '      <button type="button" class="system-tool-btn" id="systemTextCloseBtn">鍏抽棴</button>'
+                + '      <button type="button" class="system-tool-btn primary" id="systemTextCopy">澶嶅埗</button>'
+                + '    </div>'
+                + '  </div>'
+                + '</div>',
+            success: function (layero, index) {
+                licenseToolState.textLayerIndex = index;
+                layero.find("#systemDialogText").val(prettyText);
+                layero.find("#systemTextClose, #systemTextCloseBtn").on("click", function () {
+                    layer.close(index);
+                });
+                layero.find("#systemTextCopy").on("click", function () {
+                    copyRequestCodeText(prettyText);
+                });
+            },
+            end: function () {
+                licenseToolState.textLayerIndex = null;
+            }
+        });
+    }
+
+    function openLicenseInputDialog() {
+        if (licenseToolState.uploadLayerIndex !== null) {
+            layer.close(licenseToolState.uploadLayerIndex);
+        }
+        licenseToolState.uploadLayerIndex = layer.open({
+            type: 1,
+            title: false,
+            closeBtn: 0,
+            area: [Math.min($(window).width() - 32, 760) + 'px', 'auto'],
+            shadeClose: false,
+            skin: 'system-tool-popup',
+            content: ''
+                + '<div class="system-dialog-shell">'
+                + '  <div class="system-dialog-header">'
+                + '    <div class="system-dialog-title">褰曞叆璁稿彲璇�</div>'
+                + '    <span class="system-dialog-close" id="licenseInputClose">脳</span>'
+                + '  </div>'
+                + '  <div class="system-dialog-body">'
+                + '    <div class="system-dialog-label">璁稿彲璇� Base64</div>'
+                + '    <div class="system-dialog-tip">灏嗚鍙瘉鏈嶅姟绔繑鍥炵殑 license 瀛楁瀹屾暣绮樿创鍒拌繖閲屻��</div>'
+                + '    <textarea class="system-dialog-textarea" id="licenseInputValue"></textarea>'
+                + '    <div class="system-dialog-footer">'
+                + '      <button type="button" class="system-tool-btn" id="licenseInputCancel">鍙栨秷</button>'
+                + '      <button type="button" class="system-tool-btn primary" id="licenseInputSubmit">鎻愪氦</button>'
+                + '    </div>'
+                + '  </div>'
+                + '</div>',
+            success: function (layero, index) {
+                licenseToolState.uploadLayerIndex = index;
+                layero.find("#licenseInputClose, #licenseInputCancel").on("click", function () {
+                    layer.close(index);
+                });
+                layero.find("#licenseInputSubmit").on("click", function () {
+                    submitLicense(layero.find("#licenseInputValue").val());
+                });
+            },
+            end: function () {
+                licenseToolState.uploadLayerIndex = null;
+            }
+        });
+    }
+
+    function requestCode() {
+        fetchRequestCode(function (value, errorMsg) {
+            if (value) {
+                openTextDialog("鑾峰彇璇锋眰鐮�", "璇锋眰鐮�", value, "璇锋眰鐮佷腑宸插寘鍚」鐩悕绉帮紝鐩存帴鍙戠粰璁稿彲璇佹湇鍔$鍗冲彲銆�");
+                return;
+            }
+            layer.msg(errorMsg || '鑾峰彇璇锋眰鐮佸け璐�', {time: 2000});
+        });
+    }
+
+    function fetchRequestCode(callback) {
+        $.ajax({
+            url: baseUrl + "/license/getRequestCode",
+            method: 'GET',
+            success: function (res) {
+                var value = getResponseValue(res);
+                if (res.code == 200) {
+                    callback(value ? String(value) : "", "");
+                    return;
+                }
+                callback("", res.msg || '鑾峰彇璇锋眰鐮佸け璐�');
+            },
+            error: function (xhr) {
+                callback("", xhr && xhr.status === 404 ? "鑾峰彇璇锋眰鐮佹帴鍙d笉瀛樺湪" : "鑾峰彇璇锋眰鐮佸け璐�");
+            }
+        })
+    }
+
+    function getProjectName() {
+        $.ajax({
+            url: baseUrl + "/license/getProjectName",
+            method: 'GET',
+            success: function (res) {
+                var value = getResponseValue(res);
+                if (res.code == 200 && value) {
+                    layer.alert(escapeHtml(String(value)), {
+                        title: '椤圭洰鍚嶇О'
+                    });
+                    return;
+                }
+                layer.msg(res.msg || '鑾峰彇椤圭洰鍚嶇О澶辫触', {time: 2000});
+            },
+            error: function () {
+                layer.msg('鑾峰彇椤圭洰鍚嶇О澶辫触', {time: 2000});
+            }
+        })
+    }
+
+    function getServerInfo() {
+        $.ajax({
+            url: baseUrl + "/license/getServerInfos",
+            method: 'GET',
+            success: function (res) {
+                openTextDialog("鑾峰彇绯荤粺閰嶇疆", "绯荤粺閰嶇疆淇℃伅", res, "鏂拌鍙瘉妯″紡涓嬪彲鐢ㄤ簬鎺掓煡褰撳墠鑺傜偣纭欢缁戝畾淇℃伅銆�");
+            },
+            error: function () {
+                fallbackServerInfoFromRequestCode();
+            }
+        })
+    }
+
+    function fallbackServerInfoFromRequestCode() {
+        fetchRequestCode(function (requestCode, errorMsg) {
+            if (!requestCode) {
+                layer.msg(errorMsg || '鑾峰彇绯荤粺閰嶇疆淇℃伅澶辫触', {time: 2000});
+                return;
+            }
+            try {
+                var decoded = decodeRequestCodePayload(requestCode);
+                var node = (((decoded || {}).licenseBind || {}).nodes || [])[0] || {};
+                var serverInfo = {
+                    subject: decoded.subject || "",
+                    nodeId: node.nodeId || "",
+                    ipAddress: node.ipAddress || [],
+                    macAddress: node.macAddress || [],
+                    cpuSerial: node.cpuSerial || "",
+                    mainBoardSerial: node.mainBoardSerial || ""
+                };
+                openTextDialog("鑾峰彇绯荤粺閰嶇疆", "绯荤粺閰嶇疆淇℃伅", serverInfo, "褰撳墠鎺ュ彛涓嶅彲鐢紝宸叉寜璇锋眰鐮佽В鏋愬嚭鏈満鑺傜偣閰嶇疆銆�");
+            } catch (e) {
+                layer.msg('鑾峰彇绯荤粺閰嶇疆淇℃伅澶辫触', {time: 2000});
+            }
+        });
+    }
+
+    function decodeRequestCodePayload(requestCode) {
+        var normalized = String(requestCode || "").replace(/\s+/g, "");
+        if (!normalized) {
+            return {};
+        }
+        var binary = window.atob(normalized);
+        var bytes = [];
+        for (var i = 0; i < binary.length; i++) {
+            bytes.push("%" + ("00" + binary.charCodeAt(i).toString(16)).slice(-2));
+        }
+        return JSON.parse(decodeURIComponent(bytes.join("")));
+    }
+
+    function activateLicense() {
+        layer.confirm('纭畾鎵ц涓�閿縺娲诲悧锛�', {
+            title: '鎻愮ず'
+        }, function (index) {
+            layer.close(index);
+            $.ajax({
+                url: baseUrl + "/license/activate",
+                method: 'POST',
+                success: function (res) {
+                    if (res.code == 200) {
+                        layer.msg('婵�娲绘垚鍔�', {time: 1500});
+                        return;
+                    }
+                    layer.msg(res.msg || '婵�娲诲け璐�', {time: 2000});
+                },
+                error: function () {
+                    layer.msg('婵�娲诲け璐�', {time: 2000});
+                }
+            })
+        });
+    }
+
+    function submitLicense(licenseBase64) {
+        if (!licenseBase64 || !licenseBase64.trim()) {
+            layer.msg('璁稿彲璇佸唴瀹逛笉鑳戒负绌�', {time: 1500});
+            return;
+        }
+        $.ajax({
+            url: baseUrl + "/license/updateLicense",
+            headers: {'Content-Type': 'application/json'},
+            data: JSON.stringify({license: licenseBase64.trim()}),
+            method: 'POST',
+            success: function (res) {
+                if (res.code == 200) {
+                    clearLicensePromptState();
+                    clearLicenseQueryFlag();
+                    if (licenseToolState.uploadLayerIndex !== null) {
+                        layer.close(licenseToolState.uploadLayerIndex);
+                    }
+                    layer.msg('璁稿彲璇佹洿鏂版垚鍔�', {time: 1000}, function () {
+                        parent.location.reload();
+                    });
+                    return;
+                }
+                layer.msg(res.msg || '璁稿彲璇佹洿鏂板け璐�', {time: 2000});
+            },
+            error: function (xhr) {
+                if (xhr && xhr.status === 403) {
+                    layer.msg('璁稿彲璇佸綍鍏ユ帴鍙h鎷︽埅锛岃閲嶅惎鏈嶅姟鍚庨噸璇�', {time: 2500});
+                    return;
+                }
+                layer.msg('璁稿彲璇佸綍鍏ュけ璐�', {time: 2000});
+            }
+        });
+    }
+
+    function copyRequestCodeText(text) {
+        if (!text) {
+            layer.msg('璇锋眰鐮佷负绌�', {time: 1500});
+            return;
+        }
+        if (navigator.clipboard && window.isSecureContext) {
+            navigator.clipboard.writeText(text).then(function () {
+                layer.msg('璇锋眰鐮佸凡澶嶅埗', {time: 1200});
+            }, function () {
+                fallbackCopy(text);
+            });
+            return;
+        }
+        fallbackCopy(text);
+    }
+
+    function fallbackCopy(text) {
+        var copyInput = $("<textarea>").val(text).css({
+            position: "fixed",
+            top: "-1000px"
+        }).appendTo("body");
+        copyInput[0].select();
+        try {
+            document.execCommand("copy");
+            layer.msg('璇锋眰鐮佸凡澶嶅埗', {time: 1200});
+        } catch (e) {
+            layer.msg('澶嶅埗澶辫触锛岃鎵嬪姩澶嶅埗', {time: 1500});
+        }
+        copyInput.remove();
+    }
+
+    $(document).on('click', '.login-btn', function () {
+        let username = $("#username").val();
+        if (username === "") {
+            layer.tips('璇疯緭鍏ョ櫥褰曡处鍙�', '#username', {tips: [4, '#ff0000']});
+            return;
+        }
+        let password = $("#password").val();
+        if (password === "") {
+            layer.tips('璇疯緭鍏ュ瘑鐮�', '#password', {tips: [4, '#ff0000']});
+            return;
+        }
+        let params = {username: username, password: hex_md5(password)}
+        $.ajax({
+            url: baseUrl + "/login.action",
+            headers: {'Content-Type': 'application/json'},
+            data: JSON.stringify(params),
+            method: 'POST',
+            success: function (res) {
+                if (res.code === 200) {
+                    clearLicensePromptState();
+                    clearLicenseQueryFlag();
+                    localStorage.setItem("token", res.data.token);
+                    localStorage.setItem("username", res.data.username);
+                    window.location.href = "index.html";
+                } else if (res.code === 10001) {
+                    layer.tips(res.msg, '#username', {tips: [4, '#ff0000']});
+                } else if (res.code === 10002) {
+                    layer.tips(res.msg, '#username', {tips: [4, '#ff0000']});
+                } else if (res.code === 10003) {
+                    layer.tips(res.msg, '#password', {tips: [4, '#ff0000']});
+                } else if (res.code == 20001) {
+                    layer.tips(res.msg, '.login-btn', {tips: [3, '#ff0000']});
+                    showLicenseEntry(res.msg)
+                    openLicenseTool(res.msg)
+                } else {
+                    layer.tips(res.msg, '.login-btn', {tips: [3, '#ff0000']});
+                }
+            }
+        });
+    });
+
+    $('body').keydown(function () {
+        if (event.keyCode === 13) {
+            $(".login-btn").click();
         }
     });
 
-    // 鍒濆鍖栭獙璇佺爜
-    initCode();
-    $('#codeImg').click(function () {
-        initCode();
-    });
-    function initCode() {
-        var random = Math.random();
-        $('#codeImg').attr("src", baseUrl+"/code.action?sd="+random);
-        setTimeout(function () {
-            $.ajax({
-                url: baseUrl+"/code.do",
-                data: {sd: random},
-                method: 'POST',
-                async: false,
-                success: function (code) {
-                    sessionStorage.setItem("code", code);
-                }
-            });
-        }, 100);
-    }
-
-    layui.use(['form','layer'],function () {
-        var form = layui.form,
-            layer = layui.layer,
-            $ = layui.jquery;
-
-        form.on('submit(login)', function (data) {
-            var mobile = $("#mobile").val();
-            if (mobile === "") {
-                layer.msg("璇疯緭鍏ユ墜鏈哄彿", {offset: '150px'});
-                return;
-            }
-            var password = $("#password").val();
-            if (password === "") {
-                layer.msg("璇疯緭鍏ュ瘑鐮�", {offset: '150px'});
-                return;
-            }
-            var code = $("#code").val();
-            if (code === "" && codeSwitch === 'Y') {
-                layer.msg("璇疯緭鍏ラ獙璇佺爜", {offset: '150px'});
-                return;
-            }
-            if (sessionStorage.getItem("code").toUpperCase() !== code.toUpperCase()&&codeSwitch==='Y'){
-                layer.msg("楠岃瘉鐮侀敊璇�", {offset: '150px'});
-                return;
-            }
-
-            var user = {
-                mobile: mobile,
-                password: hex_md5(password)
-            };
-            $.ajax({
-                url: baseUrl+"/login.action",
-                data: user,
-                method: 'POST',
-                success: function (res) {
-                    if (res.code === 200){
-                        localStorage.setItem("token", res.data.token);
-                        localStorage.setItem("username", res.data.username);
-                        window.location.href = "index.html";
-                    } else {
-                        layer.msg(res.msg, {offset: '150px'});
-                    }
-                }
-            });
-            return false;
-        });
-
-        $('body').keydown(function () {
-            if (event.keyCode === 13) {
-                $("#login-button").click();
-            }
-        });
-
-    });
+    $("#openLicenseTool").on("click", () => {
+        openLicenseTool($("#licenseEntryMessage").text());
+    })
 </script>
-</html>
\ No newline at end of file
+</body>
+</html>

--
Gitblit v1.9.1