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} 张图片上传失败`, ); } }