Merge pull request #12893 from dataease/pr@dev-v2fix_panel_preview_cas

fix(仪表板): cas方式登录后preview页面url无法访问
This commit is contained in:
fit2cloud-chenyw 2024-10-24 16:32:17 +08:00 committed by GitHub
commit 648faeacd6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,7 +26,12 @@ const embeddedStore = useEmbedded()
const favorited = ref(false) const favorited = ref(false)
const preview = () => { const preview = () => {
const baseUrl = isDataEaseBi.value ? embeddedStore.baseUrl : '' const href = window.location.href
let baseUrl = isDataEaseBi.value ? embeddedStore.baseUrl : href.substring(0, href.indexOf('#'))
if (baseUrl.includes('oidcbi/') || baseUrl.includes('casbi/')) {
baseUrl = baseUrl.replace('oidcbi/', '')
baseUrl = baseUrl.replace('casbi/', '')
}
const url = baseUrl + '#/preview?dvId=' + dvInfo.value.id const url = baseUrl + '#/preview?dvId=' + dvInfo.value.id
const newWindow = window.open(url, '_blank') const newWindow = window.open(url, '_blank')
initOpenHandler(newWindow) initOpenHandler(newWindow)