Skip to content

Commit

Permalink
🐛 Fix: tencent cos url encode bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Molunerfinn committed Oct 24, 2022
1 parent 3a66c52 commit eafb70f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/uploader/tcyun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ const handle = async (ctx: IPicGo): Promise<IPicGo | boolean> => {
delete img.base64Image
delete img.buffer
if (customUrl) {
img.imgUrl = `${customUrl}/${encodeURIComponent(path)}${encodeURIComponent(img.fileName)}${optionUrl}`
img.imgUrl = `${customUrl}/${encodeURI(path)}${encodeURI(img.fileName)}${optionUrl}`
} else {
img.imgUrl = `https://${tcYunOptions.bucket}.cos.${tcYunOptions.area}.myqcloud.com/${encodeURIComponent(path)}${encodeURIComponent(img.fileName)}${optionUrl}`
img.imgUrl = `https://${tcYunOptions.bucket}.cos.${tcYunOptions.area}.myqcloud.com/${encodeURI(path)}${encodeURI(img.fileName)}${optionUrl}`
}
} else {
throw new Error(res.body.msg)
Expand Down

0 comments on commit eafb70f

Please sign in to comment.