Skip to content

Commit

Permalink
fix prefix add twice
Browse files Browse the repository at this point in the history
  • Loading branch information
darkskygit committed Jan 4, 2020
1 parent dd83685 commit eaf4927
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/dist/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/dist/js/app.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion web/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import xf from './xfetch'
const subdir = window.props.subdir

export function getSubDirPath(path) {
if (typeof path === 'string') {
if (
typeof path === 'string' &&
!path.startsWith(`${subdir}/`) &&
!path.startsWith(`/${subdir}/`)
) {
if (path.startsWith('/')) {
return `/${subdir}${path}`
} else {
Expand Down

0 comments on commit eaf4927

Please sign in to comment.