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

This commit is contained in:
aodi
2024-04-15 16:27:30 +08:00
parent 059d836653
commit 6c80a3a8cd
7 changed files with 8 additions and 8 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/${encodeURIComponent(url)}/0`
return `${import.meta.env.VITE_API_BASE_URL}system/img/0/${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/${encodeURIComponent(IMAGES[i])}/0`
IMAGES[i] = `${import.meta.env.VITE_API_BASE_URL}system/img/0/${IMAGES[i]}`
// canvas
const canvas = canvasRef.value