Merge pull request #8551 from dataease/pr@dev-v2_pathname

fix(嵌入式): 嵌入式二级路径问题
This commit is contained in:
dataeaseShu 2024-03-15 18:06:46 +08:00 committed by GitHub
commit 2220632f31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,7 +37,9 @@ const getPrefix = (): string => {
}
if (url.includes(suffix)) {
const { origin, pathname } = new URL(url)
prefix = `${origin}${pathname.slice(0, pathname.length - 1)}`
const splitArr = pathname.split('/')
splitArr.pop()
prefix = `${origin}${splitArr.join('/')}`
return true
}
}