优化图片地址获取逻辑:在使用图片缓存时增加登录状态检查,移除对doubanio.com的代理处理

This commit is contained in:
jxxghp
2025-04-29 13:36:36 +08:00
parent b772e2d9ef
commit 6f5dbe5808

View File

@@ -130,11 +130,8 @@ function preloadImage(url: string): Promise<boolean> {
// 计算图片地址
function getImgUrl(url: string) {
// 使用图片缓存
if (globalSettings.GLOBAL_IMAGE_CACHE)
if (globalSettings.GLOBAL_IMAGE_CACHE && isLogin.value)
return `${import.meta.env.VITE_API_BASE_URL}system/cache/image?url=${encodeURIComponent(url)}`
// 如果地址中包含douban则使用中转代理
if (url.includes('doubanio.com'))
return `${import.meta.env.VITE_API_BASE_URL}system/img/0?imgurl=${encodeURIComponent(url)}`
return url
}