mirror of
https://github.com/jiangrui1994/CloudSaver.git
synced 2026-01-12 16:18:45 +08:00
11 lines
395 B
TypeScript
11 lines
395 B
TypeScript
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;
|
|
};
|