From eafb70f50a0540785d93c478ec730baab5e9f200 Mon Sep 17 00:00:00 2001 From: PiEgg Date: Mon, 24 Oct 2022 16:47:09 +0800 Subject: [PATCH] :bug: Fix: tencent cos url encode bug --- src/plugins/uploader/tcyun.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/uploader/tcyun.ts b/src/plugins/uploader/tcyun.ts index 915ce0a..b067961 100644 --- a/src/plugins/uploader/tcyun.ts +++ b/src/plugins/uploader/tcyun.ts @@ -142,9 +142,9 @@ const handle = async (ctx: IPicGo): Promise => { 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)