From c255ef4c67423cd2d92f78660a3e5916622cf284 Mon Sep 17 00:00:00 2001 From: HuangHai <10402852@qq.com> Date: Thu, 4 Sep 2025 13:42:39 +0800 Subject: [PATCH] 'commit' --- dsLightRag/static/LibLib/wenshengtu.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dsLightRag/static/LibLib/wenshengtu.html b/dsLightRag/static/LibLib/wenshengtu.html index 6eff6681..be6d5457 100644 --- a/dsLightRag/static/LibLib/wenshengtu.html +++ b/dsLightRag/static/LibLib/wenshengtu.html @@ -585,12 +585,20 @@ resultContainer.style.display = 'block'; resultMessage.innerHTML = '
图片生成成功!
'; - // 显示生成的图片 + // 检查是否有图片数据 if (data.images && data.images.length > 0) { + // 处理图片数据(支持Base64和URL两种格式) let imagesHtml = ''; data.images.forEach((image, index) => { const imageId = `generatedImage_${Date.now()}_${index}`; - imagesHtml += `生成图片${index + 1}`; + // 检查是否为URL格式(以http或https开头) + if (typeof image === 'string' && (image.startsWith('http://') || image.startsWith('https://'))) { + // URL格式图片 + imagesHtml += `生成图片${index + 1}`; + } else { + // Base64格式图片 + imagesHtml += `生成图片${index + 1}`; + } }); resultImage.innerHTML = imagesHtml; } else {