Merge branch 'dev' into pr@dev_eslint_auto_fix

This commit is contained in:
dataeaseShu 2022-10-27 16:35:27 +08:00
commit 3c7121ceb3
17 changed files with 122 additions and 24 deletions

View File

@ -12,6 +12,7 @@ import io.dataease.auth.service.AuthUserService;
import io.dataease.auth.util.JWTUtils; import io.dataease.auth.util.JWTUtils;
import io.dataease.auth.util.RsaUtil; import io.dataease.auth.util.RsaUtil;
import io.dataease.commons.constants.SysLogConstants; import io.dataease.commons.constants.SysLogConstants;
import io.dataease.commons.exception.DEException;
import io.dataease.commons.utils.*; import io.dataease.commons.utils.*;
import io.dataease.controller.sys.request.LdapAddRequest; import io.dataease.controller.sys.request.LdapAddRequest;
import io.dataease.exception.DataEaseException; import io.dataease.exception.DataEaseException;
@ -240,8 +241,13 @@ public class AuthServer implements AuthApi {
HttpServletRequest request = ServletUtils.request(); HttpServletRequest request = ServletUtils.request();
String idToken = request.getHeader("IdToken"); String idToken = request.getHeader("IdToken");
if (StringUtils.isNotBlank(idToken)) { if (StringUtils.isNotBlank(idToken)) {
OidcXpackService oidcXpackService = SpringContextUtil.getBean(OidcXpackService.class); try {
oidcXpackService.logout(idToken); OidcXpackService oidcXpackService = SpringContextUtil.getBean(OidcXpackService.class);
oidcXpackService.logout(idToken);
} catch (Exception e) {
LogUtil.error(e.getMessage(), e);
DEException.throwException("oidc_logout_error");
}
} }
} }
@ -253,11 +259,16 @@ public class AuthServer implements AuthApi {
String result = null; String result = null;
Integer defaultLoginType = systemParameterService.defaultLoginType(); Integer defaultLoginType = systemParameterService.defaultLoginType();
if (defaultLoginType == 3 && isOpenCas()) { if (defaultLoginType == 3 && isOpenCas()) {
HttpServletRequest request = ServletUtils.request(); try {
HttpSession session = request.getSession(); HttpServletRequest request = ServletUtils.request();
session.invalidate(); HttpSession session = request.getSession();
CasXpackService casXpackService = SpringContextUtil.getBean(CasXpackService.class); session.invalidate();
result = casXpackService.logout(); CasXpackService casXpackService = SpringContextUtil.getBean(CasXpackService.class);
result = casXpackService.logout();
} catch (Exception e) {
LogUtil.error(e.getMessage(), e);
DEException.throwException("cas_logout_error");
}
} }
try { try {
Long userId = JWTUtils.tokenInfoByToken(token).getUserId(); Long userId = JWTUtils.tokenInfoByToken(token).getUserId();

View File

@ -86,6 +86,7 @@ public class ShiroServiceImpl implements ShiroService {
filterChainDefinitionMap.put("/api/auth/isOpenWecom", ANON); filterChainDefinitionMap.put("/api/auth/isOpenWecom", ANON);
filterChainDefinitionMap.put("/api/auth/isOpenDingtalk", ANON); filterChainDefinitionMap.put("/api/auth/isOpenDingtalk", ANON);
filterChainDefinitionMap.put("/api/auth/isOpenLark", ANON); filterChainDefinitionMap.put("/api/auth/isOpenLark", ANON);
filterChainDefinitionMap.put("/api/auth/isOpenCas", ANON);
filterChainDefinitionMap.put("/api/auth/isOpenLarksuite", ANON); filterChainDefinitionMap.put("/api/auth/isOpenLarksuite", ANON);
filterChainDefinitionMap.put("/api/auth/getPublicKey", ANON); filterChainDefinitionMap.put("/api/auth/getPublicKey", ANON);
filterChainDefinitionMap.put("/api/pluginCommon/component/*", ANON); filterChainDefinitionMap.put("/api/pluginCommon/component/*", ANON);
@ -106,6 +107,7 @@ public class ShiroServiceImpl implements ShiroService {
filterChainDefinitionMap.put("/plugin/larksuite/bind*", ANON); filterChainDefinitionMap.put("/plugin/larksuite/bind*", ANON);
filterChainDefinitionMap.put("/plugin/larksuite/getQrParam", ANON); filterChainDefinitionMap.put("/plugin/larksuite/getQrParam", ANON);
filterChainDefinitionMap.put("/cas/reset/**", ANON); filterChainDefinitionMap.put("/cas/reset/**", ANON);
filterChainDefinitionMap.put("/cas/loginPage", ANON);
filterChainDefinitionMap.put("/unauth", ANON); filterChainDefinitionMap.put("/unauth", ANON);
filterChainDefinitionMap.put("/display/**", ANON); filterChainDefinitionMap.put("/display/**", ANON);

View File

@ -115,4 +115,13 @@ public class CasServer {
return error; return error;
} }
} }
@GetMapping("/loginPage")
@ResponseBody
public String loginPage() {
String casServerUrlPrefix = systemParameterService.getValue("cas.login");
String callBack = systemParameterService.getValue("cas.callBack");
String result = casServerUrlPrefix + "?service=" + callBack;
return result;
}
} }

View File

@ -18,14 +18,16 @@ export function getInfo(token) {
export function logout() { export function logout() {
return request({ return request({
url: '/api/auth/logout', url: '/api/auth/logout',
method: 'post' method: 'post',
hideMsg: true
}) })
} }
export function deLogout() { export function deLogout() {
return request({ return request({
url: '/api/auth/deLogout', url: '/api/auth/deLogout',
method: 'post' method: 'post',
hideMsg: true
}) })
} }
@ -100,6 +102,13 @@ export function casStatus() {
}) })
} }
export function casLoginPage() {
return request({
url: '/cas/loginPage',
method: 'get'
})
}
export function wecomStatus() { export function wecomStatus() {
return request({ return request({
url: '/api/auth/isOpenWecom', url: '/api/auth/isOpenWecom',

View File

@ -195,7 +195,7 @@ export default {
return style return style
}, },
componentActiveFlag() { componentActiveFlag() {
return (this.curComponent && this.config === this.curComponent && !this.previewVisible && !this.showPosition.includes('email-task')) || this.showPosition.includes('multiplexing') return !this.mobileLayoutStatus && ((this.curComponent && this.config === this.curComponent && !this.previewVisible && !this.showPosition.includes('email-task')) || this.showPosition.includes('multiplexing'))
}, },
curGap() { curGap() {
return (this.canvasStyleData.panel.gap === 'yes' && this.config.auxiliaryMatrix) ? this.componentGap : 0 return (this.canvasStyleData.panel.gap === 'yes' && this.config.auxiliaryMatrix) ? this.componentGap : 0

View File

@ -56,7 +56,7 @@
</el-dropdown> </el-dropdown>
</span> </span>
<de-canvas-tab <de-canvas-tab
v-if="item.content && item.content.type==='canvas' && isEdit" v-if="item.content && item.content.type==='canvas' && isEdit && !mobileLayoutStatus"
:ref="'canvasTabRef-'+item.name" :ref="'canvasTabRef-'+item.name"
:parent-forbid="true" :parent-forbid="true"
:canvas-style-data="canvasStyleData" :canvas-style-data="canvasStyleData"
@ -66,9 +66,11 @@
:class="moveActive ? 'canvas_move_in':''" :class="moveActive ? 'canvas_move_in':''"
@canvasScroll="canvasScroll" @canvasScroll="canvasScroll"
/> />
<div style="width: 100%;height:100%"> <div
v-if="item.content && item.content.type==='canvas' && (!isEdit || mobileLayoutStatus)"
style="width: 100%;height:100%"
>
<Preview <Preview
v-if="item.content && item.content.type==='canvas' && !isEdit"
:component-data="tabCanvasComponentData(item.name)" :component-data="tabCanvasComponentData(item.name)"
:canvas-style-data="canvasStyleData" :canvas-style-data="canvasStyleData"
:canvas-id="element.id+'-'+item.name" :canvas-id="element.id+'-'+item.name"
@ -330,7 +332,8 @@ export default {
'mobileLayoutStatus', 'mobileLayoutStatus',
'canvasStyleData', 'canvasStyleData',
'tabMoveInActiveId', 'tabMoveInActiveId',
'curCanvasScaleMap' 'curCanvasScaleMap',
'pcComponentData'
]), ]),
fontColor() { fontColor() {
return this.element && this.element.style && this.element.style.headFontColor || 'none' return this.element && this.element.style && this.element.style.headFontColor || 'none'
@ -416,8 +419,12 @@ export default {
bus.$emit('onScroll') bus.$emit('onScroll')
}, },
tabCanvasComponentData(tabName) { tabCanvasComponentData(tabName) {
const result = getNowCanvasComponentData(this.element.id + '-' + tabName) const tabCanvasId = this.element.id + '-' + tabName
return result if (this.mobileLayoutStatus) {
return this.pcComponentData.filter(item => item.canvasId === tabCanvasId)
} else {
return getNowCanvasComponentData(tabCanvasId)
}
}, },
setContentThemeStyle() { setContentThemeStyle() {
this.element.options.tabList.forEach(tab => { this.element.options.tabList.forEach(tab => {

View File

@ -2625,6 +2625,7 @@ export default {
search_by_keyword: 'Search by keyword', search_by_keyword: 'Search by keyword',
apply_logs: 'Apply logs', apply_logs: 'Apply logs',
app_group_delete_tips: 'Are you sure to delete this application category?', app_group_delete_tips: 'Are you sure to delete this application category?',
app_group_delete_content: 'After deletion, all application templates in this category will also be deleted.', app_group_delete_content: 'After deletion, all application templates in this category will also be deleted.',
panel_position: 'Panel position', panel_position: 'Panel position',
panel_name: 'Panel name', panel_name: 'Panel name',
@ -2636,5 +2637,11 @@ export default {
panel: 'Panel', panel: 'Panel',
log_delete_tips: 'Are you sure to delete this application record?', log_delete_tips: 'Are you sure to delete this application record?',
log_resource_delete_tips: 'Delete related resources (irrecoverable after deletion)' log_resource_delete_tips: 'Delete related resources (irrecoverable after deletion)'
},
logout: {
oidc_logout_error: 'OIDC failed to exit, do you continue to exit DataEase?',
cas_logout_error: 'The CAS service is abnormal, please contact the administrator!'
} }
} }

View File

@ -2626,6 +2626,7 @@ export default {
search_by_keyword: '通過關鍵字搜索', search_by_keyword: '通過關鍵字搜索',
apply_logs: '應用記錄', apply_logs: '應用記錄',
app_group_delete_tips: '確定刪除該應用分類嗎?', app_group_delete_tips: '確定刪除該應用分類嗎?',
app_group_delete_content: '刪除後,該分類中所有的應用模板也將被刪除。', app_group_delete_content: '刪除後,該分類中所有的應用模板也將被刪除。',
panel_position: '儀表板位置', panel_position: '儀表板位置',
panel_name: '儀表板名稱', panel_name: '儀表板名稱',
@ -2637,5 +2638,11 @@ export default {
panel: '儀表板', panel: '儀表板',
log_delete_tips: '確定刪除該條應用記錄嗎?', log_delete_tips: '確定刪除該條應用記錄嗎?',
log_resource_delete_tips: '刪除相關資源(刪除後不可恢復)' log_resource_delete_tips: '刪除相關資源(刪除後不可恢復)'
},
logout: {
oidc_logout_error: 'OIDC退出失敗是否繼續退出DataEase',
cas_logout_error: 'CAS服務異常請聯系管理員'
} }
} }

View File

@ -2626,6 +2626,7 @@ export default {
search_by_keyword: '通过关键字搜索', search_by_keyword: '通过关键字搜索',
apply_logs: '应用记录', apply_logs: '应用记录',
app_group_delete_tips: '确定删除该应用分类吗?', app_group_delete_tips: '确定删除该应用分类吗?',
app_group_delete_content: '删除后,该分类中所有的应用模板也将被删除。', app_group_delete_content: '删除后,该分类中所有的应用模板也将被删除。',
panel_position: '仪表板位置', panel_position: '仪表板位置',
panel_name: '仪表板名称', panel_name: '仪表板名称',
@ -2637,5 +2638,11 @@ export default {
panel: '仪表板', panel: '仪表板',
log_delete_tips: '确定删除该条应用记录吗?', log_delete_tips: '确定删除该条应用记录吗?',
log_resource_delete_tips: '删除相关资源(删除后不可恢复)' log_resource_delete_tips: '删除相关资源(删除后不可恢复)'
},
logout: {
oidc_logout_error: 'OIDC退出失败是否继续退出DataEase',
cas_logout_error: 'CAS服务异常请联系管理员'
} }
} }

View File

@ -6,6 +6,7 @@ import { getLanguage } from '@/lang/index'
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import router from '@/router' import router from '@/router'
import i18n from '@/lang' import i18n from '@/lang'
import { $alert, $confirm } from '@/utils/message'
const getDefaultState = () => { const getDefaultState = () => {
return { return {
token: getToken(), token: getToken(),
@ -146,6 +147,28 @@ const actions = {
resolve(res.data) resolve(res.data)
}).catch(error => { }).catch(error => {
reject(error) reject(error)
if (error?.response?.data?.message) {
if (error.response.data.message === ('oidc_logout_error')) {
const message = i18n.t('logout.' + error.response.data.message)
$confirm(message, () => {
removeToken() // must remove token first
resetRouter()
commit('RESET_STATE')
window.location.href = '/'
}, {
confirmButtonText: i18n.t('commons.confirm')
})
}
if (error.response.data.message === ('cas_logout_error')) {
const message = i18n.t('logout.' + error.response.data.message)
$alert(message, () => {
}, {
confirmButtonText: i18n.t('commons.confirm'),
showClose: false
})
}
}
}) })
}) })
}, },

View File

@ -51,7 +51,7 @@
:title="$t('chart.assist_line')" :title="$t('chart.assist_line')"
:visible="editLineDialog" :visible="editLineDialog"
:show-close="false" :show-close="false"
width="70%" width="1000px"
class="dialog-css" class="dialog-css"
> >
<assist-line-edit <assist-line-edit

View File

@ -243,7 +243,7 @@
:title="$t('chart.threshold')" :title="$t('chart.threshold')"
:visible="editLabelThresholdDialog" :visible="editLabelThresholdDialog"
:show-close="false" :show-close="false"
width="50%" width="800px"
class="dialog-css" class="dialog-css"
append-to-body append-to-body
> >
@ -274,7 +274,7 @@
:title="$t('chart.threshold')" :title="$t('chart.threshold')"
:visible="editTableThresholdDialog" :visible="editTableThresholdDialog"
:show-close="false" :show-close="false"
width="50%" width="800px"
class="dialog-css" class="dialog-css"
append-to-body append-to-body
> >

View File

@ -17,6 +17,7 @@
<el-input <el-input
v-model="item.name" v-model="item.name"
class="value-item" class="value-item"
style="width: 90% !important;"
:placeholder="$t('chart.name')" :placeholder="$t('chart.name')"
size="mini" size="mini"
clearable clearable
@ -97,6 +98,7 @@
v-model="item.summary" v-model="item.summary"
size="mini" size="mini"
class="select-item" class="select-item"
style="margin-left: 10px;"
:placeholder="$t('chart.aggregation')" :placeholder="$t('chart.aggregation')"
@change="changeAssistLine" @change="changeAssistLine"
> >

View File

@ -100,6 +100,7 @@
v-show="!item.term.includes('null') && !item.term.includes('empty') && item.term !== 'between'" v-show="!item.term.includes('null') && !item.term.includes('empty') && item.term !== 'between'"
v-model="item.value" v-model="item.value"
class="value-item" class="value-item"
style="margin-left: 10px;"
:placeholder="$t('chart.drag_block_label_value')" :placeholder="$t('chart.drag_block_label_value')"
size="mini" size="mini"
clearable clearable

View File

@ -130,17 +130,17 @@
> >
<el-row class="code-contaniner"> <el-row class="code-contaniner">
<plugin-com <plugin-com
v-if="loginTypes.includes(4) && codeIndex === 4" v-if="codeShow && loginTypes.includes(4) && codeIndex === 4"
ref="WecomQr" ref="WecomQr"
component-name="WecomQr" component-name="WecomQr"
/> />
<plugin-com <plugin-com
v-if="loginTypes.includes(5) && codeIndex === 5" v-if="codeShow && loginTypes.includes(5) && codeIndex === 5"
ref="DingtalkQr" ref="DingtalkQr"
component-name="DingtalkQr" component-name="DingtalkQr"
/> />
<plugin-com <plugin-com
v-if="loginTypes.includes(6) && codeIndex === 6" v-if="codeShow && loginTypes.includes(6) && codeIndex === 6"
ref="LarkQr" ref="LarkQr"
component-name="LarkQr" component-name="LarkQr"
/> />
@ -210,7 +210,7 @@
<script> <script>
import { encrypt } from '@/utils/rsaEncrypt' import { encrypt } from '@/utils/rsaEncrypt'
import { ldapStatus, oidcStatus, getPublicKey, pluginLoaded, defaultLoginType, wecomStatus, dingtalkStatus, larkStatus, larksuiteStatus } from '@/api/user' import { ldapStatus, oidcStatus, getPublicKey, pluginLoaded, defaultLoginType, wecomStatus, dingtalkStatus, larkStatus, larksuiteStatus, casStatus, casLoginPage } from '@/api/user'
import { getSysUI } from '@/utils/auth' import { getSysUI } from '@/utils/auth'
import { changeFavicon } from '@/utils/index' import { changeFavicon } from '@/utils/index'
import { initTheme } from '@/utils/ThemeUtil' import { initTheme } from '@/utils/ThemeUtil'
@ -282,6 +282,12 @@ export default {
this.contentShow = true this.contentShow = true
}) })
casStatus().then(res => {
if (res.success && res.data) {
this.loginTypes.push(3)
}
})
ldapStatus().then(res => { ldapStatus().then(res => {
if (res.success && res.data) { if (res.success && res.data) {
this.loginTypes.push(1) this.loginTypes.push(1)
@ -340,6 +346,12 @@ export default {
if (res && res.success) { if (res && res.success) {
this.defaultType = res.data this.defaultType = res.data
} }
if (this.loginTypes.includes(3) && this.defaultType === 3) {
casLoginPage().then(res => {
debugger
window.location.href = res.data
})
}
this.setDefaultType() this.setDefaultType()
}) })
}, },

View File

@ -6,7 +6,7 @@
<el-row class="component-wait-main"> <el-row class="component-wait-main">
<el-col <el-col
v-for="(config) in pcComponentData" v-for="(config) in pcComponentData"
v-if="!config.mobileSelected" v-if="!config.mobileSelected && config.canvasId === 'canvas-main'"
:id="'wait' + config.id" :id="'wait' + config.id"
:key="config.id" :key="config.id"
:span="8" :span="8"

View File

@ -1511,6 +1511,7 @@ export default {
color: gray; color: gray;
height: 30px; height: 30px;
width: 100%; width: 100%;
text-align: center;
} }
.this_mobile_canvas_bottom { .this_mobile_canvas_bottom {