From 3a311dba44d2e56aeb7f43726f3342e5d8de4c4a Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Thu, 5 Nov 2020 14:31:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):?= =?UTF-8?q?=20=E6=98=BE=E7=A4=BA=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/business/App.vue | 14 +++++--------- frontend/src/business/components/xpack | 2 +- frontend/src/login/Login.vue | 17 +++++++---------- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/frontend/src/business/App.vue b/frontend/src/business/App.vue index ff55980514..3cdb8af86a 100644 --- a/frontend/src/business/App.vue +++ b/frontend/src/business/App.vue @@ -34,6 +34,7 @@ import {saveLocalStorage} from "@/common/js/utils"; const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/); const header = requireComponent.keys().length > 0 ? requireComponent("./license/LicenseMessage.vue") : {}; +const display = requireComponent.keys().length > 0 ? requireComponent("./display/Display.vue") : {}; export default { name: 'app', @@ -56,6 +57,10 @@ export default { if (header.default !== undefined) { this.licenseHeader = "LicenseMessage"; } + // 是否显示校验信息 + if (display.default !== undefined) { + display.default.valid(this); + } } else { window.location.href = "/login" } @@ -63,15 +68,6 @@ export default { window.location.href = "/login" }); }, - created() { - this.$get("/display/info", response => { - this.logoId = response.data[0].paramValue; - let title = response.data[4].paramValue; - if (title) { - document.title = title; - } - }) - }, components: { MsLanguageSwitch, MsUser, diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 119a689244..b9091a47b1 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 119a6892443b634a30d0d599ea51274d3c412372 +Subproject commit b9091a47b197faef77c72b134b7cf604fe3209f0 diff --git a/frontend/src/login/Login.vue b/frontend/src/login/Login.vue index b032a9bac1..7c4e25cf23 100644 --- a/frontend/src/login/Login.vue +++ b/frontend/src/login/Login.vue @@ -53,6 +53,8 @@ import {saveLocalStorage} from '@/common/js/utils'; import {DEFAULT_LANGUAGE} from "@/common/js/constants"; +const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/); +const display = requireComponent.keys().length > 0 ? requireComponent("./display/Display.vue") : {}; export default { name: "Login", @@ -91,6 +93,11 @@ export default { }, beforeCreate() { this.result = this.$get("/isLogin").then(response => { + + if (display.default !== undefined) { + display.default.valid(this); + } + if (!response.data.success) { if (response.data.message === 'sso') { window.location.href = "/sso/login" @@ -111,16 +118,6 @@ export default { created: function () { // 主页添加键盘事件,注意,不能直接在焦点事件上添加回车 document.addEventListener("keydown", this.watchEnter); - - this.result = this.$get("/display/info", response => { - this.loginLogoId = response.data[1].paramValue; - this.loginImageId = response.data[2].paramValue; - - let loginTitle = response.data[3].paramValue; - if (loginTitle) { - document.title = loginTitle; - } - }) }, destroyed() {