Skip to content

Commit 8cbc550

Browse files
committed
fix prefix add twice
1 parent a927a13 commit 8cbc550

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

web/src/api.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import xf from './xfetch'
33
const subdir = window.props.subdir
44

55
export function getSubDirPath(path) {
6-
if (typeof path === 'string') {
6+
if (
7+
typeof path === 'string' &&
8+
!path.startsWith(`${subdir}/`) &&
9+
!path.startsWith(`/${subdir}/`)
10+
) {
711
if (path.startsWith('/')) {
812
return `/${subdir}${path}`
913
} else {

0 commit comments

Comments
 (0)