fix(image): 修复审核图片鉴权加载

This commit is contained in:
yml
2026-11-24 22:43:59 +08:00
parent 43df96a973
commit 4c7271bcb7
3 changed files with 24 additions and 48 deletions
@@ -12,6 +12,7 @@ import {
ZoomIn,
ZoomOut,
} from '@element-plus/icons-vue'
import AuthImage from '@/shared/components/business/AuthImage.vue'
export interface PreviewScreenshotItem {
url: string
@@ -25,12 +26,10 @@ const props = withDefaults(
images: PreviewScreenshotItem[]
initialIndex?: number
isPeekMode?: boolean
previewUrls?: Record<string, string>
}>(),
{
initialIndex: 0,
isPeekMode: false,
previewUrls: () => ({}),
}
)
@@ -68,11 +67,6 @@ const currentItem = computed<PreviewScreenshotItem | null>(() => {
return props.images[currentIndex.value] || props.images[0] || null
})
const currentDisplayUrl = computed(() => {
if (!currentItem.value) return ''
return props.previewUrls[currentItem.value.url] || currentItem.value.url
})
const imageTransformStyle = computed(() => ({
transform: `scale(${zoomScale.value}) rotate(${rotationDeg.value}deg)`,
transition: 'transform 0.2s cubic-bezier(0.4, 0, 0.2, 1)',
@@ -272,12 +266,13 @@ onUnmounted(() => {
<!-- Image Stage -->
<div class="image-stage" @click.self="handleClose">
<img
:src="currentDisplayUrl"
<AuthImage
:source="currentItem.url"
:alt="currentItem.label"
:style="imageTransformStyle"
class="preview-image"
draggable="false"
variant="medium"
:image-style="imageTransformStyle"
image-class="preview-image"
loading="eager"
/>
</div>