Junjie
2 天以前 5447ff1e5abeb1d45c9e331f78a0e523695b2561
src/main/webapp/static/js/login/login.js
@@ -18,6 +18,9 @@
                uploadDialogVisible: false,
                mfaDialogVisible: false,
                licenseBase64: "",
                brandLogo: "",
                brandTitle: "",
                brandCopyright: "",
                titleClickCount: 0,
                titleClickTimer: null,
                loginForm: {
@@ -64,6 +67,7 @@
        },
        created: function () {
            this.initLanguageSwitch();
            this.loadBranding();
        },
        methods: {
            text: function (key, fallback) {
@@ -77,6 +81,27 @@
                }
                return fallback || key;
            },
            loadBranding: function () {
                var that = this;
                $.ajax({
                    url: baseUrl + "/openapi/getBranding",
                    method: "GET",
                    success: function (res) {
                        if (res.code === 200 && res.data) {
                            that.brandLogo = res.data.logo || "";
                            that.brandTitle = res.data.title || "";
                            that.brandCopyright = res.data.copyright || "";
                            if (res.data.title) {
                                document.title = res.data.title + " - 登录";
                            }
                            if (res.data.logo) {
                                var link = document.querySelector('link[rel="icon"]');
                                if (link) link.href = res.data.logo.indexOf("data:") === 0 ? res.data.logo : res.data.logo + "?v=" + Date.now();
                            }
                        }
                    }
                });
            },
            refreshRuleMessages: function () {
                var vm = this;
                vm.loginRules = {