mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-05-22 22:57:35 +08:00
fix: image proxy logic
This commit is contained in:
@@ -13,12 +13,14 @@ export function getImageProxyUrl(): string | null {
|
|||||||
if (enableImageProxy !== null) {
|
if (enableImageProxy !== null) {
|
||||||
if (!JSON.parse(enableImageProxy) as boolean) {
|
if (!JSON.parse(enableImageProxy) as boolean) {
|
||||||
return null;
|
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;
|
const serverImageProxy = (window as any).RUNTIME_CONFIG?.IMAGE_PROXY;
|
||||||
return serverImageProxy && serverImageProxy.trim()
|
return serverImageProxy && serverImageProxy.trim()
|
||||||
|
|||||||
Reference in New Issue
Block a user