From 4c7271bcb7428c762b64cafc90fed1f7a3b4963b Mon Sep 17 00:00:00 2001 From: yml Date: Tue, 24 Nov 2026 22:43:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(image):=20=E4=BF=AE=E5=A4=8D=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E5=9B=BE=E7=89=87=E9=89=B4=E6=9D=83=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdminListingReviewEvidenceDialog.vue | 12 +++--- .../AdminListingReviewPreviewDialog.vue | 19 ++++----- .../admin/views/AdminListingReviewView.vue | 41 +++++-------------- 3 files changed, 24 insertions(+), 48 deletions(-) diff --git a/frontend/src/features/admin/components/AdminListingReviewEvidenceDialog.vue b/frontend/src/features/admin/components/AdminListingReviewEvidenceDialog.vue index 49fa3bd9..a90802c1 100644 --- a/frontend/src/features/admin/components/AdminListingReviewEvidenceDialog.vue +++ b/frontend/src/features/admin/components/AdminListingReviewEvidenceDialog.vue @@ -2,7 +2,8 @@ import { computed, ref, watch } from 'vue' import { EditPen, FullScreen, Pointer } from '@element-plus/icons-vue' import type { Listing } from '@/features/listings' -import { formatListingCode, getScreenshotThumbURL } from '@/shared/utils/listingDisplay' +import AuthImage from '@/shared/components/business/AuthImage.vue' +import { formatListingCode } from '@/shared/utils/listingDisplay' interface ReviewScreenshotItem { url: string @@ -139,11 +140,12 @@ function handleEdit(shot: ReviewScreenshotItem) { @click="handleView(index)" >
- 默认占位图 {{ shot.label }} diff --git a/frontend/src/features/admin/components/AdminListingReviewPreviewDialog.vue b/frontend/src/features/admin/components/AdminListingReviewPreviewDialog.vue index f661eb23..4ab7beb7 100644 --- a/frontend/src/features/admin/components/AdminListingReviewPreviewDialog.vue +++ b/frontend/src/features/admin/components/AdminListingReviewPreviewDialog.vue @@ -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 }>(), { initialIndex: 0, isPeekMode: false, - previewUrls: () => ({}), } ) @@ -68,11 +67,6 @@ const currentItem = computed(() => { 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(() => {
-
diff --git a/frontend/src/features/admin/views/AdminListingReviewView.vue b/frontend/src/features/admin/views/AdminListingReviewView.vue index 331ef36c..ba10b32c 100644 --- a/frontend/src/features/admin/views/AdminListingReviewView.vue +++ b/frontend/src/features/admin/views/AdminListingReviewView.vue @@ -26,9 +26,10 @@ import { WarningFilled, } from '@element-plus/icons-vue' import { ElMessage, ElMessageBox } from 'element-plus' -import { computed, nextTick, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue' +import { computed, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue' import { fetchAdminFileBlob } from '@/shared/api/files' +import AuthImage from '@/shared/components/business/AuthImage.vue' import { adminPath } from '@/shared/utils/adminPath' import { centToYuan, formatCent, formatMoneyWithSymbol } from '@/shared/utils/money' import { @@ -54,8 +55,6 @@ import { getFaceOwnerText, getListingConsumablePrice, getListingResources, - getScreenshotMediumURL, - getScreenshotThumbURL, getOnlineTimeText, getResourceQuantity, getSkinNames, @@ -103,13 +102,6 @@ interface ChecklistItem { const _defaultScreenshotURL = '/api/listings/default-upload-screenshot?v=webp1' -function onThumbError(e: Event) { - const target = e.target as HTMLImageElement - if (target && target.src !== _defaultScreenshotURL) { - target.src = _defaultScreenshotURL - } -} - const sortOptions = [ { label: '最新提交 (默认)', value: 'default' }, { label: '风险优先 (封禁/默认图)', value: 'risk' }, @@ -145,7 +137,6 @@ const filters = reactive({ risk: 'all', sortBy: 'default', }) -const previewURLs = reactive>({}) const lastRefreshedAt = ref('') const shortcutsDialogVisible = ref(false) @@ -249,8 +240,6 @@ watch( async listing => { if (!listing) return selectedID.value = listing.id - await nextTick() - prepareScreenshotPreviews(listing) }, { immediate: true } ) @@ -455,7 +444,6 @@ async function onPriceAdjustSave(payload: { function openEvidence(row: Listing) { evidenceListing.value = row evidenceDialogVisible.value = true - prepareScreenshotPreviews(row) } function money(value: number) { @@ -780,12 +768,6 @@ function extractObjectKey(url: string) { } } -function prepareScreenshotPreviews(row: Listing) { - for (const url of row.screenshot_urls || []) { - previewURLs[url] = isDefaultScreenshot(url) ? url : getScreenshotMediumURL(url) - } -} - function getListingScreenshots(item: Listing | null): ReviewScreenshotItem[] { if (!item) return [] const groups = item.asset_summary?.screenshot_groups @@ -935,7 +917,6 @@ async function handleScreenshotSaved(payload: { oldUrl: string; newUrl: string } evidenceListing.value.screenshot_urls = nextUrls } - prepareScreenshotPreviews(targetListing) editorVisible.value = false editingScreenshot.value = null } @@ -1103,12 +1084,10 @@ async function handleScreenshotSaved(payload: { oldUrl: string; newUrl: string }
- 缩略图 默认图
@@ -1591,11 +1570,12 @@ async function handleScreenshotSaved(payload: { oldUrl: string; newUrl: string } @click="handleCardClick(selectedReviewScreenshots, index)" >
- 默认占位图 @@ -1702,7 +1682,6 @@ async function handleScreenshotSaved(payload: { oldUrl: string; newUrl: string } v-model:is-peek-mode="isPeekMode" :images="previewScreenshots" :initial-index="previewInitialIndex" - :preview-urls="previewURLs" @edit="handlePreviewEdit" @open-raw="openRawScreenshot" />