From 93d6c773b8561561b9cabcf8f3278e7a09f45dbb Mon Sep 17 00:00:00 2001 From: mtvpls <247332661+mtvpls@users.noreply.github.com> Date: Tue, 14 Jul 2026 01:30:52 +0800 Subject: [PATCH] Revert "feat: extend image proxy to all images, not just douban" This reverts commit d682cee427d2dec932d264625574b0b1b3d08551. --- src/lib/utils.ts | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 00751f2..bfd7920 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -399,11 +399,6 @@ export function processImageUrl(originalUrl: string): string { return originalUrl; } - // 如果不是 http/https 开头(相对路径、data URI 等),直接返回 - if (!originalUrl.startsWith('http://') && !originalUrl.startsWith('https://')) { - return originalUrl; - } - // 处理 TMDB 图片 URL 替换 if (originalUrl.includes('image.tmdb.org')) { if (typeof window !== 'undefined') { @@ -429,21 +424,12 @@ export function processImageUrl(originalUrl: string): string { } // 处理豆瓣图片代理 - if (originalUrl.includes('doubanio.com')) { - const { proxyType, proxyUrl } = getDoubanImageProxyConfig(); - return buildDoubanImageUrl(originalUrl, proxyType, proxyUrl); + if (!originalUrl.includes('doubanio.com')) { + return originalUrl; } - // 其他图片(视频源封面图等)走本站代理,带缓存 - // 可通过 localStorage 'proxyAllImages' = 'false' 关闭 - if (typeof window !== 'undefined') { - const proxyAll = localStorage.getItem('proxyAllImages'); - if (proxyAll !== 'false') { - return `/api/image-proxy?url=${encodeURIComponent(originalUrl)}`; - } - } - - return originalUrl; + const { proxyType, proxyUrl } = getDoubanImageProxyConfig(); + return buildDoubanImageUrl(originalUrl, proxyType, proxyUrl); } /**