fix: 嵌入式div方式在动态访问路径场景下静态资源路径错误

This commit is contained in:
fit2cloud-chenyw 2024-03-20 15:56:23 +08:00
parent 62b9fcefa2
commit 86be49dd49
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
}
}