Skip to content

Commit

Permalink
🐛 Fix(custom): fix webdav url bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuingsmile committed Sep 3, 2024
1 parent 2ba3daa commit 38bc174
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/uploader/webdav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ const handle = async (ctx: IPicGo): Promise<IPicGo | boolean> => {
delete img.buffer
const baseUrl = customUrl || webdavplistOptions.host
if (webdavplistOptions.webpath) {
img.imgUrl = `${baseUrl}/${encodePath(`${webpath}${img.fileName}`)}${suffix}`
img.imgUrl = `${baseUrl}/${encodePath(`${webpath}${img.fileName}`).replace(/^\/+/g, '')}${suffix}`
} else {
img.imgUrl = `${baseUrl}/${encodePath(`${uploadPath}${img.fileName}`)}${suffix}`
img.imgUrl = `${baseUrl}/${encodePath(`${uploadPath}${img.fileName}`).replace(/^\/+/g, '')}${suffix}`
}
img.galleryPath = `http://localhost:36699/webdavplist/${encodeURIComponent(img.fileName)}`
} else {
Expand Down

0 comments on commit 38bc174

Please sign in to comment.