Merge pull request #10881 from dataease/pr@dev-v2@fix_dynamic_path_cas

fix(X-Pack): 配置动态url前缀的场景下无法进行cas/oidc认证
This commit is contained in:
fit2cloud-chenyw 2024-07-10 15:06:02 +08:00 committed by GitHub
commit 9e914b2b1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View File

@ -21,13 +21,21 @@ export const logoutHandler = (justClean?: boolean) => {
if (router.currentRoute.value.fullPath) { if (router.currentRoute.value.fullPath) {
queryRedirectPath = router.currentRoute.value.fullPath as string queryRedirectPath = router.currentRoute.value.fullPath as string
} }
let pathname = window.location.pathname
if (pathname) {
if (pathname.includes('oidcbi/') || pathname.includes('casbi/')) {
pathname = pathname.replace('oidcbi/', '')
pathname = pathname.replace('casbi/', '')
}
pathname = pathname.substring(0, pathname.length - 1)
}
if (wsCache.get('out_auth_platform') === 'cas') { if (wsCache.get('out_auth_platform') === 'cas') {
const uri = window.location.href const uri = window.location.href
window.location.href = '/casbi/cas/logout?service=' + uri window.location.href = pathname + '/casbi/cas/logout?service=' + uri
return return
} }
if (wsCache.get('out_auth_platform') === 'oidc') { if (wsCache.get('out_auth_platform') === 'oidc') {
window.location.href = '/oidcbi/oidc/logout' window.location.href = pathname + '/oidcbi/oidc/logout'
return return
} }
if (wsCache.get('custom_auth_logout_url')) { if (wsCache.get('custom_auth_logout_url')) {

@ -1 +1 @@
Subproject commit f0fde70871bc17a8e3660c7c8563418e87cc8b87 Subproject commit d21daef323ca920d8f2ca467b5a69f018d30384b