feat(系统管理-外观配置): 增加登录页脚设置

This commit is contained in:
fit2cloud-chenyw 2022-08-22 11:14:39 +08:00
parent 7e26874d12
commit 18e554dab2
6 changed files with 121 additions and 63 deletions

View File

@ -8,14 +8,17 @@ import io.dataease.controller.sys.response.BasicInfo;
import io.dataease.dto.SystemParameterDTO; import io.dataease.dto.SystemParameterDTO;
import io.dataease.exception.DataEaseException; import io.dataease.exception.DataEaseException;
import io.dataease.plugins.common.base.domain.FileMetadata; import io.dataease.plugins.common.base.domain.FileMetadata;
import io.dataease.plugins.common.base.domain.SysParamAssist;
import io.dataease.plugins.common.base.domain.SystemParameter; import io.dataease.plugins.common.base.domain.SystemParameter;
import io.dataease.plugins.common.base.domain.SystemParameterExample; import io.dataease.plugins.common.base.domain.SystemParameterExample;
import io.dataease.plugins.common.base.mapper.SystemParameterMapper; import io.dataease.plugins.common.base.mapper.SystemParameterMapper;
import io.dataease.plugins.config.SpringContextUtil; import io.dataease.plugins.config.SpringContextUtil;
import io.dataease.plugins.xpack.cas.dto.CasSaveResult; import io.dataease.plugins.xpack.cas.dto.CasSaveResult;
import io.dataease.plugins.xpack.cas.service.CasXpackService; import io.dataease.plugins.xpack.cas.service.CasXpackService;
import io.dataease.plugins.xpack.display.service.DisplayXpackService;
import io.dataease.service.FileService; import io.dataease.service.FileService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -26,6 +29,7 @@ import javax.annotation.Resource;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
@ -231,6 +235,20 @@ public class SystemParameterService {
systemParameterDTO.setFileName(fileMetadata.getName()); systemParameterDTO.setFileName(fileMetadata.getName());
} }
} }
if (systemParameter.getType().equalsIgnoreCase("blob")) {
Map<String, DisplayXpackService> beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType((DisplayXpackService.class));
DisplayXpackService displayXpackService = null;
if (beansOfType.keySet().size() > 0 && (displayXpackService = SpringContextUtil.getBean(DisplayXpackService.class)) != null) {
String paramValue = systemParameter.getParamValue();
if (StringUtils.isNotBlank(paramValue)) {
long blobId = Long.parseLong(paramValue);
String content = displayXpackService.readBlob(blobId);
systemParameterDTO.setParamValue(content);
}
} else {
systemParameterDTO.setParamValue(null);
}
}
dtoList.add(systemParameterDTO); dtoList.add(systemParameterDTO);
} }
dtoList.sort(Comparator.comparingInt(SystemParameter::getSort)); dtoList.sort(Comparator.comparingInt(SystemParameter::getSort));

View File

@ -22,3 +22,13 @@ INSERT INTO `sys_menu` VALUES (750, 2, 0, 2, '导入用户', NULL, NULL, 999, NU
update system_parameter set sort = (sort + 1) where sort > 3; update system_parameter set sort = (sort + 1) where sort > 3;
update system_parameter set sort = 4 where param_key = 'ui.favicon' update system_parameter set sort = 4 where param_key = 'ui.favicon'
INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.showFoot', NULL, 'text', 18);
INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.footContent', NULL, 'blob', 19);
CREATE TABLE IF NOT EXISTS `sys_param_assist` (
`id` BIGINT(21) NOT NULL AUTO_INCREMENT,
`content` MEDIUMBLOB COMMENT '内容',
PRIMARY KEY (id)
)

View File

@ -1987,7 +1987,9 @@ export default {
mobileBG: 'Mobile Login page BG', mobileBG: 'Mobile Login page BG',
helpLink: 'Help Document Link', helpLink: 'Help Document Link',
homeLink: 'Home Link', homeLink: 'Home Link',
defaultHomeLink: 'Default is the system built-in home page' defaultHomeLink: 'Default is the system built-in home page',
showFoot: 'Show login page footer',
footContent: 'Foot content'
}, },
auth: { auth: {

View File

@ -1995,7 +1995,9 @@ export default {
mobileBG: '移動端登錄頁背景', mobileBG: '移動端登錄頁背景',
helpLink: '幫助文檔鏈接', helpLink: '幫助文檔鏈接',
homeLink: '首頁鏈接', homeLink: '首頁鏈接',
defaultHomeLink: '默認為系統內置首頁' defaultHomeLink: '默認為系統內置首頁',
showFoot: '顯示登錄頁腳',
footContent: '頁腳內容'
}, },
auth: { auth: {

View File

@ -2005,8 +2005,9 @@ export default {
mobileBG: '移动端登录页背景', mobileBG: '移动端登录页背景',
helpLink: '帮助文档链接', helpLink: '帮助文档链接',
homeLink: '首页链接', homeLink: '首页链接',
defaultHomeLink: '默认为系统内置首页' defaultHomeLink: '默认为系统内置首页',
showFoot: '显示登录页脚',
footContent: '页脚内容'
}, },
auth: { auth: {
no_item_selected: '请在左侧选择组织、角色或用户', no_item_selected: '请在左侧选择组织、角色或用户',

View File

@ -1,4 +1,5 @@
<template> <template>
<div>
<div v-show="contentShow" class="login-background"> <div v-show="contentShow" class="login-background">
<div class="login-container"> <div class="login-container">
<el-row v-loading="loading" type="flex"> <el-row v-loading="loading" type="flex">
@ -56,10 +57,13 @@
<div v-if="loginImageUrl && axiosFinished" class="login-image-de" :style="{background:'url(' + loginImageUrl + ') no-repeat', 'backgroundSize':'contain'}" /> <div v-if="loginImageUrl && axiosFinished" class="login-image-de" :style="{background:'url(' + loginImageUrl + ') no-repeat', 'backgroundSize':'contain'}" />
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<plugin-com v-if="loginTypes.includes(2) && loginForm.loginType === 2" ref="SSOComponent" component-name="SSOComponent" /> <plugin-com v-if="loginTypes.includes(2) && loginForm.loginType === 2" ref="SSOComponent" component-name="SSOComponent" />
</div> </div>
<div v-if="showFoot" class="dynamic-login-foot" v-html="footContent"></div>
</div>
</template> </template>
<script> <script>
@ -101,7 +105,9 @@ export default {
'chart-tree', 'chart-tree',
'dataset-tree' 'dataset-tree'
], ],
defaultType: 0 defaultType: 0,
showFoot: false,
footContent: ''
} }
}, },
computed: { computed: {
@ -201,6 +207,13 @@ export default {
const faviconUrl = '/system/ui/image/' + this.uiInfo['ui.favicon'].paramValue const faviconUrl = '/system/ui/image/' + this.uiInfo['ui.favicon'].paramValue
changeFavicon(faviconUrl) changeFavicon(faviconUrl)
} }
if(this.uiInfo['ui.showFoot'] && this.uiInfo['ui.showFoot'].paramValue) {
this.showFoot = this.uiInfo['ui.showFoot'].paramValue === true || this.uiInfo['ui.showFoot'].paramValue === 'true'
if(this.showFoot) {
const content = this.uiInfo['ui.footContent'] && this.uiInfo['ui.footContent'].paramValue
this.footContent = content
}
}
}, },
initCache() { initCache() {
this.clearLocalStorage.forEach(item => { this.clearLocalStorage.forEach(item => {
@ -387,4 +400,16 @@ export default {
} }
} }
} }
.dynamic-login-foot {
visibility: visible;
width: 100%;
position: fixed;
z-index: 302;
bottom: 0;
left: 0;
height: auto;
padding-top: 1px;
zoom: 1;
margin: 0;
}
</style> </style>