From 6937f5e1b1a7273576add53e9e75e8910895591e Mon Sep 17 00:00:00 2001 From: Aqr-K <95741669+Aqr-K@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:39:38 +0800 Subject: [PATCH] feat(user): New avatar file add webp format support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新头像增加 `webp` 格式支持 --- src/components/dialog/UserAddEditDialog.vue | 4 ++-- src/views/user/UserProfileView.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/dialog/UserAddEditDialog.vue b/src/components/dialog/UserAddEditDialog.vue index cf42e778..e1cf2691 100644 --- a/src/components/dialog/UserAddEditDialog.vue +++ b/src/components/dialog/UserAddEditDialog.vue @@ -83,7 +83,7 @@ function changeAvatar(file: Event) { const { files } = file.target as HTMLInputElement if (files && files.length > 0) { const selectedFile = files[0] - const allowedTypes = ['image/jpeg', 'image/png', 'image/gif'] + const allowedTypes = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'] const maxSize = 800 * 1024 // 检查文件是否为图片 if (!allowedTypes.includes(selectedFile.type)) { @@ -303,7 +303,7 @@ onMounted(() => { -
允许 JPG、PNG、GIF 格式, 最大尺寸 800KB。
+允许 JPG、PNG、GIF、WEBP 格式, 最大尺寸 800KB。
允许 JPG、PNG、GIF 格式, 最大尺寸 800KB。
+允许 JPG、PNG、GIF、WEBP 格式, 最大尺寸 800KB。