🐛 修正链接判断逻辑

This commit is contained in:
BTMuli
2025-10-02 12:18:25 +08:00
parent eac3691d0b
commit 7a6a06bb25

View File

@@ -85,10 +85,10 @@ const useAppStore = defineStore(
}
function getImageUrl(url: string, fmt?: string): string {
let check = false;
let check = true;
if (fmt && !["jpg", "png", "webp", "gif", "jpeg"].includes(fmt.toLowerCase())) check = false;
if (check && (url.endsWith(".gif") || imageQualityPercent.value === 100)) return url;
return `${url}?x-oss-process=image/format,jpg/quality,Q_${imageQualityPercent.value}`;
if (url.endsWith(".gif") || (check && imageQualityPercent.value === 100)) return url;
return `${url}?x-oss-process=image/format,png/quality,Q_${imageQualityPercent.value}`;
}
return {