From dfab95a654dae6dfefe3febab178bf59d70e74a2 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 3 Nov 2026 09:26:31 +0800 Subject: [PATCH] Recover home previews through the documented storage alias --- components/home/lovart/home-image.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/components/home/lovart/home-image.tsx b/components/home/lovart/home-image.tsx index 3d2ea404b..bfb6e6ba9 100644 --- a/components/home/lovart/home-image.tsx +++ b/components/home/lovart/home-image.tsx @@ -12,9 +12,24 @@ type HomeImageProps = { onUnavailable?: () => void; }; +function imageCandidates(source: string) { + // These two domains are documented aliases for the same gongxiangpan store. + // Do not rewrite other buckets, providers, signed URLs or user-supplied hosts. + try { + const url = new URL(source); + if (url.origin === "https://s3.yydd.ai" && + url.pathname.startsWith("/gongxiangpan/") && !url.search && !url.hash) { + return [`https://s3.jiansun.vip${url.pathname}`, source]; + } + } catch { /* Relative site assets need no host rewrite. */ } + return [source]; +} + /** Keep failed image elements out of view, trying each distinct source once. */ export function HomeImage(props: HomeImageProps) { - const sources = [...new Set(props.sources.filter((url): url is string => Boolean(url?.trim())))]; + const sources = [...new Set(props.sources + .filter((url): url is string => Boolean(url?.trim())) + .flatMap(imageCandidates))]; return ; }