fix 编码斜杠禁用的反代无法加载图片 修改url编码

This commit is contained in:
aodi
2024-04-15 17:14:21 +08:00
parent 6c80a3a8cd
commit b22d81a9e9
6 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -56,7 +56,7 @@ function getImgUrl(url: string) {
if (!url)
return getDefaultImage()
else
return `${import.meta.env.VITE_API_BASE_URL}system/img/0/${url}`
return `${import.meta.env.VITE_API_BASE_URL}system/img/0/${encodeURI(url)}`
}
// 根据多张图片生成媒体库封面
@@ -68,7 +68,7 @@ async function drawImages(imageList: string[]) {
// 为所有图片添加system/img前缀
for (let i = 0; i < IMAGES.length; i++)
IMAGES[i] = `${import.meta.env.VITE_API_BASE_URL}system/img/0/${IMAGES[i]}`
IMAGES[i] = `${import.meta.env.VITE_API_BASE_URL}system/img/0/${encodeURI(IMAGES[i])}`
// canvas
const canvas = canvasRef.value