From 4c7b6e98da6b1a5937a4da05db10e3165892242a Mon Sep 17 00:00:00 2001 From: MSuMshk <2039814060@qq.com> Date: Tue, 24 Feb 2026 09:35:34 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E7=BB=9F=E4=B8=80=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=80=BB=E8=BE=91=E4=BB=A3=E7=A0=81=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product-detail-page/data-actions.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/web-antd/src/views/product/detail/composables/product-detail-page/data-actions.ts b/apps/web-antd/src/views/product/detail/composables/product-detail-page/data-actions.ts index 187e2f1..ce9a2b9 100644 --- a/apps/web-antd/src/views/product/detail/composables/product-detail-page/data-actions.ts +++ b/apps/web-antd/src/views/product/detail/composables/product-detail-page/data-actions.ts @@ -167,12 +167,16 @@ export function createProductDetailDataActions( } function isAllowedProductImageFile(file: File) { - const mimeType = String(file.type || '').trim().toLowerCase(); + const mimeType = String(file.type || '') + .trim() + .toLowerCase(); if (mimeType && ALLOWED_PRODUCT_IMAGE_MIME_SET.has(mimeType)) { return true; } - const lowerName = String(file.name || '').trim().toLowerCase(); + const lowerName = String(file.name || '') + .trim() + .toLowerCase(); return ALLOWED_PRODUCT_IMAGE_EXT.some((ext) => lowerName.endsWith(ext)); } @@ -184,7 +188,9 @@ export function createProductDetailDataActions( return; } - const invalidFiles = files.filter((file) => !isAllowedProductImageFile(file)); + const invalidFiles = files.filter( + (file) => !isAllowedProductImageFile(file), + ); if (invalidFiles.length > 0) { message.warning('仅支持 JPG/PNG/WEBP 格式'); } @@ -235,7 +241,9 @@ export function createProductDetailDataActions( } if (failedCount > 0) { message.error( - failedCount === 1 ? '1 张图片上传失败' : `${failedCount} 张图片上传失败`, + failedCount === 1 + ? '1 张图片上传失败' + : `${failedCount} 张图片上传失败`, ); } }