Skip to content

Commit eafb70f

Browse files
committed
🐛 Fix: tencent cos url encode bug
1 parent 3a66c52 commit eafb70f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/plugins/uploader/tcyun.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ const handle = async (ctx: IPicGo): Promise<IPicGo | boolean> => {
142142
delete img.base64Image
143143
delete img.buffer
144144
if (customUrl) {
145-
img.imgUrl = `${customUrl}/${encodeURIComponent(path)}${encodeURIComponent(img.fileName)}${optionUrl}`
145+
img.imgUrl = `${customUrl}/${encodeURI(path)}${encodeURI(img.fileName)}${optionUrl}`
146146
} else {
147-
img.imgUrl = `https://${tcYunOptions.bucket}.cos.${tcYunOptions.area}.myqcloud.com/${encodeURIComponent(path)}${encodeURIComponent(img.fileName)}${optionUrl}`
147+
img.imgUrl = `https://${tcYunOptions.bucket}.cos.${tcYunOptions.area}.myqcloud.com/${encodeURI(path)}${encodeURI(img.fileName)}${optionUrl}`
148148
}
149149
} else {
150150
throw new Error(res.body.msg)

0 commit comments

Comments
 (0)