Merge pull request #8605 from dataease/pr@dev-v2@fix_embedded_div_dynamic_url

fix: 嵌入式div方式在动态访问路径场景下静态资源路径错误
This commit is contained in:
fit2cloud-chenyw 2024-03-20 15:58:11 +08:00 committed by GitHub
commit f8461e62fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -99,6 +99,10 @@ htmlStream.pipe(parserStream).on('finish', () => {
}
if (url.includes(suffix)) {
prefix = new URL(url).origin
const index = url.indexOf(\`/js/div_import_${suffix}\`)
if (index > 0) {
prefix = url.substring(0, index)
}
return true
}
}

View File

@ -37,6 +37,10 @@ const getPrefix = (): string => {
}
if (url.includes(suffix)) {
prefix = new URL(url).origin
const index = url.indexOf(`/js/div_import_${suffix}`)
if (index > 0) {
prefix = url.substring(0, index)
}
return true
}
}