ng / frontend /src /utils /image.ts
epii-1
222222
f0953a4
raw
history blame contribute delete
395 Bytes
import { useUserSettingStore } from "@/stores/userSetting";
import defaultImage from "@/assets/images/default.png";
export const getProxyImageUrl = (originalUrl: string): string => {
const userStore = useUserSettingStore();
if (!originalUrl) return defaultImage;
return userStore.imagesSource === "proxy"
? `/tele-images/?url=${encodeURIComponent(originalUrl)}`
: originalUrl;
};