forked from github/dataease
Merge pull request #2882 from dataease/pr@dev@feat_login_foot
feat(系统管理-外观配置): 增加登录页脚设置
This commit is contained in:
commit
2dec6adae4
@ -8,14 +8,17 @@ import io.dataease.controller.sys.response.BasicInfo;
|
||||
import io.dataease.dto.SystemParameterDTO;
|
||||
import io.dataease.exception.DataEaseException;
|
||||
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.SystemParameterExample;
|
||||
import io.dataease.plugins.common.base.mapper.SystemParameterMapper;
|
||||
import io.dataease.plugins.config.SpringContextUtil;
|
||||
import io.dataease.plugins.xpack.cas.dto.CasSaveResult;
|
||||
import io.dataease.plugins.xpack.cas.service.CasXpackService;
|
||||
import io.dataease.plugins.xpack.display.service.DisplayXpackService;
|
||||
import io.dataease.service.FileService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -26,6 +29,7 @@ import javax.annotation.Resource;
|
||||
import javax.imageio.ImageIO;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
@ -231,6 +235,20 @@ public class SystemParameterService {
|
||||
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.sort(Comparator.comparingInt(SystemParameter::getSort));
|
||||
|
@ -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 = 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)
|
||||
)
|
||||
|
||||
|
@ -1987,7 +1987,9 @@ export default {
|
||||
mobileBG: 'Mobile Login page BG',
|
||||
helpLink: 'Help Document 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: {
|
||||
|
@ -1995,7 +1995,9 @@ export default {
|
||||
mobileBG: '移動端登錄頁背景',
|
||||
helpLink: '幫助文檔鏈接',
|
||||
homeLink: '首頁鏈接',
|
||||
defaultHomeLink: '默認為系統內置首頁'
|
||||
defaultHomeLink: '默認為系統內置首頁',
|
||||
showFoot: '顯示登錄頁腳',
|
||||
footContent: '頁腳內容'
|
||||
|
||||
},
|
||||
auth: {
|
||||
|
@ -2005,8 +2005,9 @@ export default {
|
||||
mobileBG: '移动端登录页背景',
|
||||
helpLink: '帮助文档链接',
|
||||
homeLink: '首页链接',
|
||||
defaultHomeLink: '默认为系统内置首页'
|
||||
|
||||
defaultHomeLink: '默认为系统内置首页',
|
||||
showFoot: '显示登录页脚',
|
||||
footContent: '页脚内容'
|
||||
},
|
||||
auth: {
|
||||
no_item_selected: '请在左侧选择组织、角色或用户',
|
||||
|
@ -1,64 +1,68 @@
|
||||
<template>
|
||||
<div v-show="contentShow" class="login-background">
|
||||
<div class="login-container">
|
||||
<el-row v-loading="loading" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" size="default">
|
||||
<div class="login-logo">
|
||||
<svg-icon v-if="!loginLogoUrl && axiosFinished" icon-class="DataEase" custom-class="login-logo-icon" />
|
||||
<img v-if="loginLogoUrl && axiosFinished" :src="loginLogoUrl" alt="">
|
||||
</div>
|
||||
<div v-if="uiInfo && uiInfo['ui.loginTitle'] && uiInfo['ui.loginTitle'].paramValue" class="login-welcome">
|
||||
{{ uiInfo['ui.loginTitle'].paramValue }}
|
||||
</div>
|
||||
<div v-else class="login-welcome">
|
||||
{{ $t('login.welcome') + (uiInfo && uiInfo['ui.title'] && uiInfo['ui.title'].paramValue || ' DataEase') }}
|
||||
</div>
|
||||
<div class="login-form">
|
||||
<el-form-item v-if="loginTypes.length > 1">
|
||||
<el-radio-group v-if="loginTypes.length > 1" v-model="loginForm.loginType" @change="changeLoginType">
|
||||
<el-radio :label="0" size="mini">{{ $t('login.default_login') }}</el-radio>
|
||||
<el-radio v-if="loginTypes.includes(1)" :label="1" size="mini">LDAP</el-radio>
|
||||
<el-radio v-if="loginTypes.includes(2)" :label="2" size="mini">OIDC</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="loginForm.username" placeholder="ID" autofocus :disabled="loginTypes.includes(2) && loginForm.loginType === 2" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input
|
||||
v-model="loginForm.password"
|
||||
:placeholder="$t('login.password')"
|
||||
show-password
|
||||
maxlength="30"
|
||||
show-word-limit
|
||||
autocomplete="new-password"
|
||||
:disabled="loginTypes.includes(2) && loginForm.loginType === 2"
|
||||
@keypress.enter.native="handleLogin"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="login-btn">
|
||||
<el-button type="primary" class="submit" size="default" :disabled="loginTypes.includes(2) && loginForm.loginType === 2" @click.native.prevent="handleLogin">
|
||||
{{ $t('commons.login') }}
|
||||
</el-button>
|
||||
<div v-if="uiInfo && uiInfo['ui.demo.tips'] && uiInfo['ui.demo.tips'].paramValue" class="demo-tips">
|
||||
{{ uiInfo['ui.demo.tips'].paramValue }}
|
||||
<div>
|
||||
<div v-show="contentShow" class="login-background">
|
||||
<div class="login-container">
|
||||
<el-row v-loading="loading" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" size="default">
|
||||
<div class="login-logo">
|
||||
<svg-icon v-if="!loginLogoUrl && axiosFinished" icon-class="DataEase" custom-class="login-logo-icon" />
|
||||
<img v-if="loginLogoUrl && axiosFinished" :src="loginLogoUrl" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-msg">
|
||||
{{ msg }}
|
||||
</div>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col v-loading="!axiosFinished" :span="12">
|
||||
<div v-if="!loginImageUrl && axiosFinished" class="login-image" />
|
||||
<div v-if="loginImageUrl && axiosFinished" class="login-image-de" :style="{background:'url(' + loginImageUrl + ') no-repeat', 'backgroundSize':'contain'}" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-if="uiInfo && uiInfo['ui.loginTitle'] && uiInfo['ui.loginTitle'].paramValue" class="login-welcome">
|
||||
{{ uiInfo['ui.loginTitle'].paramValue }}
|
||||
</div>
|
||||
<div v-else class="login-welcome">
|
||||
{{ $t('login.welcome') + (uiInfo && uiInfo['ui.title'] && uiInfo['ui.title'].paramValue || ' DataEase') }}
|
||||
</div>
|
||||
<div class="login-form">
|
||||
<el-form-item v-if="loginTypes.length > 1">
|
||||
<el-radio-group v-if="loginTypes.length > 1" v-model="loginForm.loginType" @change="changeLoginType">
|
||||
<el-radio :label="0" size="mini">{{ $t('login.default_login') }}</el-radio>
|
||||
<el-radio v-if="loginTypes.includes(1)" :label="1" size="mini">LDAP</el-radio>
|
||||
<el-radio v-if="loginTypes.includes(2)" :label="2" size="mini">OIDC</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="loginForm.username" placeholder="ID" autofocus :disabled="loginTypes.includes(2) && loginForm.loginType === 2" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input
|
||||
v-model="loginForm.password"
|
||||
:placeholder="$t('login.password')"
|
||||
show-password
|
||||
maxlength="30"
|
||||
show-word-limit
|
||||
autocomplete="new-password"
|
||||
:disabled="loginTypes.includes(2) && loginForm.loginType === 2"
|
||||
@keypress.enter.native="handleLogin"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="login-btn">
|
||||
<el-button type="primary" class="submit" size="default" :disabled="loginTypes.includes(2) && loginForm.loginType === 2" @click.native.prevent="handleLogin">
|
||||
{{ $t('commons.login') }}
|
||||
</el-button>
|
||||
<div v-if="uiInfo && uiInfo['ui.demo.tips'] && uiInfo['ui.demo.tips'].paramValue" class="demo-tips">
|
||||
{{ uiInfo['ui.demo.tips'].paramValue }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="login-msg">
|
||||
{{ msg }}
|
||||
</div>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col v-loading="!axiosFinished" :span="12">
|
||||
<div v-if="!loginImageUrl && axiosFinished" class="login-image" />
|
||||
<div v-if="loginImageUrl && axiosFinished" class="login-image-de" :style="{background:'url(' + loginImageUrl + ') no-repeat', 'backgroundSize':'contain'}" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</div>
|
||||
<plugin-com v-if="loginTypes.includes(2) && loginForm.loginType === 2" ref="SSOComponent" component-name="SSOComponent" />
|
||||
|
||||
</div>
|
||||
<plugin-com v-if="loginTypes.includes(2) && loginForm.loginType === 2" ref="SSOComponent" component-name="SSOComponent" />
|
||||
|
||||
<div v-if="showFoot" class="dynamic-login-foot" v-html="footContent"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -101,7 +105,9 @@ export default {
|
||||
'chart-tree',
|
||||
'dataset-tree'
|
||||
],
|
||||
defaultType: 0
|
||||
defaultType: 0,
|
||||
showFoot: false,
|
||||
footContent: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -200,6 +206,13 @@ export default {
|
||||
const faviconUrl = '/system/ui/image/' + this.uiInfo['ui.favicon'].paramValue
|
||||
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() {
|
||||
this.clearLocalStorage.forEach(item => {
|
||||
@ -386,4 +399,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>
|
||||
|
Loading…
Reference in New Issue
Block a user