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 ; }