refactor(系统设置): 显示设置

This commit is contained in:
Captain.B 2020-11-05 14:31:24 +08:00
parent 9aeed6b027
commit 3a311dba44
3 changed files with 13 additions and 20 deletions

View File

@ -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,

@ -1 +1 @@
Subproject commit 119a6892443b634a30d0d599ea51274d3c412372
Subproject commit b9091a47b197faef77c72b134b7cf604fe3209f0

View File

@ -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() {