自动化立体仓库 - WMS系统
zwl
14 小时以前 df79f2a0702de355d96c6889adf61977b4284005
src/main/webapp/views/login.html
@@ -314,9 +314,17 @@
        if (!needOpen) {
            return;
        }
        var message = sessionStorage.getItem("licenseInvalidReason") || "系统当前未检测到可用许可证,请先导入新的许可证。";
        showLicenseEntry(message);
        openLicenseTool(message);
        verifyLicenseAvailability(function (isValid) {
            if (isValid) {
                clearLicensePromptState();
                hideLicenseEntry();
                clearLicenseQueryFlag();
                return;
            }
            var message = sessionStorage.getItem("licenseInvalidReason") || "系统当前未检测到可用许可证,请先导入新的许可证。";
            showLicenseEntry(message);
            openLicenseTool(message);
        });
    }
    function showLicenseEntry(message) {
@@ -324,6 +332,39 @@
        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) {
@@ -645,8 +686,8 @@
            method: 'POST',
            success: function (res) {
                if (res.code == 200) {
                    sessionStorage.removeItem("licensePanelAutoOpen");
                    sessionStorage.removeItem("licenseInvalidReason");
                    clearLicensePromptState();
                    clearLicenseQueryFlag();
                    if (licenseToolState.uploadLayerIndex !== null) {
                        layer.close(licenseToolState.uploadLayerIndex);
                    }
@@ -717,6 +758,8 @@
            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";