diff --git a/backend/src/main/java/io/dataease/auth/server/AuthServer.java b/backend/src/main/java/io/dataease/auth/server/AuthServer.java index ac43dc69ce..e86731d06f 100644 --- a/backend/src/main/java/io/dataease/auth/server/AuthServer.java +++ b/backend/src/main/java/io/dataease/auth/server/AuthServer.java @@ -12,6 +12,7 @@ import io.dataease.auth.service.AuthUserService; import io.dataease.auth.util.JWTUtils; import io.dataease.auth.util.RsaUtil; import io.dataease.commons.constants.SysLogConstants; +import io.dataease.commons.exception.DEException; import io.dataease.commons.utils.*; import io.dataease.controller.sys.request.LdapAddRequest; import io.dataease.exception.DataEaseException; @@ -240,8 +241,13 @@ public class AuthServer implements AuthApi { HttpServletRequest request = ServletUtils.request(); String idToken = request.getHeader("IdToken"); if (StringUtils.isNotBlank(idToken)) { - OidcXpackService oidcXpackService = SpringContextUtil.getBean(OidcXpackService.class); - oidcXpackService.logout(idToken); + try { + 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; Integer defaultLoginType = systemParameterService.defaultLoginType(); if (defaultLoginType == 3 && isOpenCas()) { - HttpServletRequest request = ServletUtils.request(); - HttpSession session = request.getSession(); - session.invalidate(); - CasXpackService casXpackService = SpringContextUtil.getBean(CasXpackService.class); - result = casXpackService.logout(); + try { + HttpServletRequest request = ServletUtils.request(); + HttpSession session = request.getSession(); + session.invalidate(); + CasXpackService casXpackService = SpringContextUtil.getBean(CasXpackService.class); + result = casXpackService.logout(); + } catch (Exception e) { + LogUtil.error(e.getMessage(), e); + DEException.throwException("cas_logout_error"); + } } try { Long userId = JWTUtils.tokenInfoByToken(token).getUserId(); diff --git a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java index b92517f050..0fd46ef9a9 100644 --- a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java +++ b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java @@ -86,6 +86,7 @@ public class ShiroServiceImpl implements ShiroService { filterChainDefinitionMap.put("/api/auth/isOpenWecom", ANON); filterChainDefinitionMap.put("/api/auth/isOpenDingtalk", ANON); filterChainDefinitionMap.put("/api/auth/isOpenLark", ANON); + filterChainDefinitionMap.put("/api/auth/isOpenCas", ANON); filterChainDefinitionMap.put("/api/auth/isOpenLarksuite", ANON); filterChainDefinitionMap.put("/api/auth/getPublicKey", 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/getQrParam", ANON); filterChainDefinitionMap.put("/cas/reset/**", ANON); + filterChainDefinitionMap.put("/cas/loginPage", ANON); filterChainDefinitionMap.put("/unauth", ANON); filterChainDefinitionMap.put("/display/**", ANON); diff --git a/backend/src/main/java/io/dataease/plugins/server/CasServer.java b/backend/src/main/java/io/dataease/plugins/server/CasServer.java index c54639c1b3..9a68ebec93 100644 --- a/backend/src/main/java/io/dataease/plugins/server/CasServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/CasServer.java @@ -115,4 +115,13 @@ public class CasServer { 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; + } } diff --git a/frontend/src/api/user.js b/frontend/src/api/user.js index 32d2067307..ac4b3154b0 100644 --- a/frontend/src/api/user.js +++ b/frontend/src/api/user.js @@ -18,14 +18,16 @@ export function getInfo(token) { export function logout() { return request({ url: '/api/auth/logout', - method: 'post' + method: 'post', + hideMsg: true }) } export function deLogout() { return request({ 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() { return request({ url: '/api/auth/isOpenWecom', diff --git a/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue b/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue index cf18c101c3..50407a9c93 100644 --- a/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue +++ b/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue @@ -195,7 +195,7 @@ export default { return style }, 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() { return (this.canvasStyleData.panel.gap === 'yes' && this.config.auxiliaryMatrix) ? this.componentGap : 0 diff --git a/frontend/src/components/widget/DeWidget/DeTabs.vue b/frontend/src/components/widget/DeWidget/DeTabs.vue index edb11049dd..b97cd577fd 100644 --- a/frontend/src/components/widget/DeWidget/DeTabs.vue +++ b/frontend/src/components/widget/DeWidget/DeTabs.vue @@ -56,7 +56,7 @@ -
+
item.canvasId === tabCanvasId) + } else { + return getNowCanvasComponentData(tabCanvasId) + } }, setContentThemeStyle() { this.element.options.tabList.forEach(tab => { diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 4813e90f42..2396463285 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -2625,6 +2625,7 @@ export default { search_by_keyword: 'Search by keyword', apply_logs: 'Apply logs', 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.', panel_position: 'Panel position', panel_name: 'Panel name', @@ -2636,5 +2637,11 @@ export default { panel: 'Panel', log_delete_tips: 'Are you sure to delete this application record?', 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!' } } diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 4471ffd44f..ea714565cd 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -2626,6 +2626,7 @@ export default { search_by_keyword: '通過關鍵字搜索', apply_logs: '應用記錄', app_group_delete_tips: '確定刪除該應用分類嗎?', + app_group_delete_content: '刪除後,該分類中所有的應用模板也將被刪除。', panel_position: '儀表板位置', panel_name: '儀表板名稱', @@ -2637,5 +2638,11 @@ export default { panel: '儀表板', log_delete_tips: '確定刪除該條應用記錄嗎?', log_resource_delete_tips: '刪除相關資源(刪除後不可恢復)' + + }, + + logout: { + oidc_logout_error: 'OIDC退出失敗,是否繼續退出DataEase?', + cas_logout_error: 'CAS服務異常,請聯系管理員!' } } diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 639bbd037b..87bdeea425 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -2626,6 +2626,7 @@ export default { search_by_keyword: '通过关键字搜索', apply_logs: '应用记录', app_group_delete_tips: '确定删除该应用分类吗?', + app_group_delete_content: '删除后,该分类中所有的应用模板也将被删除。', panel_position: '仪表板位置', panel_name: '仪表板名称', @@ -2637,5 +2638,11 @@ export default { panel: '仪表板', log_delete_tips: '确定删除该条应用记录吗?', log_resource_delete_tips: '删除相关资源(删除后不可恢复)' + + }, + + logout: { + oidc_logout_error: 'OIDC退出失败,是否继续退出DataEase?', + cas_logout_error: 'CAS服务异常,请联系管理员!' } } diff --git a/frontend/src/store/modules/user.js b/frontend/src/store/modules/user.js index a14a2db029..5d8795d358 100644 --- a/frontend/src/store/modules/user.js +++ b/frontend/src/store/modules/user.js @@ -6,6 +6,7 @@ import { getLanguage } from '@/lang/index' import Cookies from 'js-cookie' import router from '@/router' import i18n from '@/lang' +import { $alert, $confirm } from '@/utils/message' const getDefaultState = () => { return { token: getToken(), @@ -146,6 +147,28 @@ const actions = { resolve(res.data) }).catch(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 + }) + } + } }) }) }, diff --git a/frontend/src/views/chart/components/senior/AssistLine.vue b/frontend/src/views/chart/components/senior/AssistLine.vue index b0eef1e46a..0b9c24af06 100644 --- a/frontend/src/views/chart/components/senior/AssistLine.vue +++ b/frontend/src/views/chart/components/senior/AssistLine.vue @@ -51,7 +51,7 @@ :title="$t('chart.assist_line')" :visible="editLineDialog" :show-close="false" - width="70%" + width="1000px" class="dialog-css" > @@ -274,7 +274,7 @@ :title="$t('chart.threshold')" :visible="editTableThresholdDialog" :show-close="false" - width="50%" + width="800px" class="dialog-css" append-to-body > diff --git a/frontend/src/views/chart/components/senior/dialog/AssistLineEdit.vue b/frontend/src/views/chart/components/senior/dialog/AssistLineEdit.vue index 21e133f793..655a2a4a7c 100644 --- a/frontend/src/views/chart/components/senior/dialog/AssistLineEdit.vue +++ b/frontend/src/views/chart/components/senior/dialog/AssistLineEdit.vue @@ -17,6 +17,7 @@ diff --git a/frontend/src/views/chart/components/senior/dialog/TableThresholdEdit.vue b/frontend/src/views/chart/components/senior/dialog/TableThresholdEdit.vue index 073dfdee8b..119bd29ce7 100644 --- a/frontend/src/views/chart/components/senior/dialog/TableThresholdEdit.vue +++ b/frontend/src/views/chart/components/senior/dialog/TableThresholdEdit.vue @@ -100,6 +100,7 @@ v-show="!item.term.includes('null') && !item.term.includes('empty') && item.term !== 'between'" v-model="item.value" class="value-item" + style="margin-left: 10px;" :placeholder="$t('chart.drag_block_label_value')" size="mini" clearable diff --git a/frontend/src/views/login/index.vue b/frontend/src/views/login/index.vue index e5881db818..6765a686eb 100644 --- a/frontend/src/views/login/index.vue +++ b/frontend/src/views/login/index.vue @@ -130,17 +130,17 @@ > @@ -210,7 +210,7 @@