forked from github/dataease
Merge branch 'dev' into pr@dev_eslint_auto_fix
This commit is contained in:
commit
3c7121ceb3
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
|
@ -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
|
||||
|
@ -56,7 +56,7 @@
|
||||
</el-dropdown>
|
||||
</span>
|
||||
<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"
|
||||
:parent-forbid="true"
|
||||
:canvas-style-data="canvasStyleData"
|
||||
@ -66,9 +66,11 @@
|
||||
:class="moveActive ? 'canvas_move_in':''"
|
||||
@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
|
||||
v-if="item.content && item.content.type==='canvas' && !isEdit"
|
||||
:component-data="tabCanvasComponentData(item.name)"
|
||||
:canvas-style-data="canvasStyleData"
|
||||
:canvas-id="element.id+'-'+item.name"
|
||||
@ -330,7 +332,8 @@ export default {
|
||||
'mobileLayoutStatus',
|
||||
'canvasStyleData',
|
||||
'tabMoveInActiveId',
|
||||
'curCanvasScaleMap'
|
||||
'curCanvasScaleMap',
|
||||
'pcComponentData'
|
||||
]),
|
||||
fontColor() {
|
||||
return this.element && this.element.style && this.element.style.headFontColor || 'none'
|
||||
@ -416,8 +419,12 @@ export default {
|
||||
bus.$emit('onScroll')
|
||||
},
|
||||
tabCanvasComponentData(tabName) {
|
||||
const result = getNowCanvasComponentData(this.element.id + '-' + tabName)
|
||||
return result
|
||||
const tabCanvasId = this.element.id + '-' + tabName
|
||||
if (this.mobileLayoutStatus) {
|
||||
return this.pcComponentData.filter(item => item.canvasId === tabCanvasId)
|
||||
} else {
|
||||
return getNowCanvasComponentData(tabCanvasId)
|
||||
}
|
||||
},
|
||||
setContentThemeStyle() {
|
||||
this.element.options.tabList.forEach(tab => {
|
||||
|
@ -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!'
|
||||
}
|
||||
}
|
||||
|
@ -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服務異常,請聯系管理員!'
|
||||
}
|
||||
}
|
||||
|
@ -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服务异常,请联系管理员!'
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
@ -51,7 +51,7 @@
|
||||
:title="$t('chart.assist_line')"
|
||||
:visible="editLineDialog"
|
||||
:show-close="false"
|
||||
width="70%"
|
||||
width="1000px"
|
||||
class="dialog-css"
|
||||
>
|
||||
<assist-line-edit
|
||||
|
@ -243,7 +243,7 @@
|
||||
:title="$t('chart.threshold')"
|
||||
:visible="editLabelThresholdDialog"
|
||||
:show-close="false"
|
||||
width="50%"
|
||||
width="800px"
|
||||
class="dialog-css"
|
||||
append-to-body
|
||||
>
|
||||
@ -274,7 +274,7 @@
|
||||
:title="$t('chart.threshold')"
|
||||
:visible="editTableThresholdDialog"
|
||||
:show-close="false"
|
||||
width="50%"
|
||||
width="800px"
|
||||
class="dialog-css"
|
||||
append-to-body
|
||||
>
|
||||
|
@ -17,6 +17,7 @@
|
||||
<el-input
|
||||
v-model="item.name"
|
||||
class="value-item"
|
||||
style="width: 90% !important;"
|
||||
:placeholder="$t('chart.name')"
|
||||
size="mini"
|
||||
clearable
|
||||
@ -97,6 +98,7 @@
|
||||
v-model="item.summary"
|
||||
size="mini"
|
||||
class="select-item"
|
||||
style="margin-left: 10px;"
|
||||
:placeholder="$t('chart.aggregation')"
|
||||
@change="changeAssistLine"
|
||||
>
|
||||
|
@ -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
|
||||
|
@ -130,17 +130,17 @@
|
||||
>
|
||||
<el-row class="code-contaniner">
|
||||
<plugin-com
|
||||
v-if="loginTypes.includes(4) && codeIndex === 4"
|
||||
v-if="codeShow && loginTypes.includes(4) && codeIndex === 4"
|
||||
ref="WecomQr"
|
||||
component-name="WecomQr"
|
||||
/>
|
||||
<plugin-com
|
||||
v-if="loginTypes.includes(5) && codeIndex === 5"
|
||||
v-if="codeShow && loginTypes.includes(5) && codeIndex === 5"
|
||||
ref="DingtalkQr"
|
||||
component-name="DingtalkQr"
|
||||
/>
|
||||
<plugin-com
|
||||
v-if="loginTypes.includes(6) && codeIndex === 6"
|
||||
v-if="codeShow && loginTypes.includes(6) && codeIndex === 6"
|
||||
ref="LarkQr"
|
||||
component-name="LarkQr"
|
||||
/>
|
||||
@ -210,7 +210,7 @@
|
||||
<script>
|
||||
|
||||
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 { changeFavicon } from '@/utils/index'
|
||||
import { initTheme } from '@/utils/ThemeUtil'
|
||||
@ -282,6 +282,12 @@ export default {
|
||||
this.contentShow = true
|
||||
})
|
||||
|
||||
casStatus().then(res => {
|
||||
if (res.success && res.data) {
|
||||
this.loginTypes.push(3)
|
||||
}
|
||||
})
|
||||
|
||||
ldapStatus().then(res => {
|
||||
if (res.success && res.data) {
|
||||
this.loginTypes.push(1)
|
||||
@ -340,6 +346,12 @@ export default {
|
||||
if (res && res.success) {
|
||||
this.defaultType = res.data
|
||||
}
|
||||
if (this.loginTypes.includes(3) && this.defaultType === 3) {
|
||||
casLoginPage().then(res => {
|
||||
debugger
|
||||
window.location.href = res.data
|
||||
})
|
||||
}
|
||||
this.setDefaultType()
|
||||
})
|
||||
},
|
||||
|
@ -6,7 +6,7 @@
|
||||
<el-row class="component-wait-main">
|
||||
<el-col
|
||||
v-for="(config) in pcComponentData"
|
||||
v-if="!config.mobileSelected"
|
||||
v-if="!config.mobileSelected && config.canvasId === 'canvas-main'"
|
||||
:id="'wait' + config.id"
|
||||
:key="config.id"
|
||||
:span="8"
|
||||
|
@ -1511,6 +1511,7 @@ export default {
|
||||
color: gray;
|
||||
height: 30px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.this_mobile_canvas_bottom {
|
||||
|
Loading…
Reference in New Issue
Block a user