fix(登出): 对接cas后退出系统没有跳转到cas登录页面issues/2909

This commit is contained in:
fit2cloud-chenyw 2022-10-27 16:08:21 +08:00
parent 0cb0e3ff79
commit b19914ce6b
4 changed files with 34 additions and 4 deletions

View File

@ -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);

View File

@ -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;
}
}

View File

@ -100,6 +100,13 @@ export function casStatus() {
})
}
export function casLoginPage() {
return request({
url: '/cas/loginPage',
method: 'get'
})
}
export function wecomStatus() {
return request({
url: '/api/auth/isOpenWecom',

View File

@ -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()
})
},