mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-02-21 17:24:41 +08:00
fix: image proxy logic
This commit is contained in:
@@ -13,12 +13,14 @@ export function getImageProxyUrl(): string | null {
|
||||
if (enableImageProxy !== null) {
|
||||
if (!JSON.parse(enableImageProxy) as boolean) {
|
||||
return null;
|
||||
} else {
|
||||
// 启用,直接返回本地配置
|
||||
return localStorage.getItem('imageProxyUrl')?.trim() || null;
|
||||
}
|
||||
}
|
||||
|
||||
const localImageProxy = localStorage.getItem('imageProxyUrl');
|
||||
if (localImageProxy != null) {
|
||||
return localImageProxy.trim() ? localImageProxy.trim() : null;
|
||||
}
|
||||
|
||||
// 如果未设置,则使用全局对象
|
||||
const serverImageProxy = (window as any).RUNTIME_CONFIG?.IMAGE_PROXY;
|
||||
return serverImageProxy && serverImageProxy.trim()
|
||||
|
||||
Reference in New Issue
Block a user