mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-19 18:49:30 +08:00
feat(user): New avatar file add webp format support
- 新头像增加 `webp` 格式支持
This commit is contained in:
@@ -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(() => {
|
||||
</VBtn>
|
||||
</div>
|
||||
|
||||
<p class="text-body-1 mb-0">允许 JPG、PNG、GIF 格式, 最大尺寸 800KB。</p>
|
||||
<p class="text-body-1 mb-0">允许 JPG、PNG、GIF、WEBP 格式, 最大尺寸 800KB。</p>
|
||||
</form>
|
||||
</VCardText>
|
||||
<VCardText>
|
||||
|
||||
@@ -75,7 +75,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)) {
|
||||
@@ -297,7 +297,7 @@ watch(
|
||||
</VBtn>
|
||||
</div>
|
||||
|
||||
<p class="text-body-1 mb-0">允许 JPG、PNG、GIF 格式, 最大尺寸 800KB。</p>
|
||||
<p class="text-body-1 mb-0">允许 JPG、PNG、GIF、WEBP 格式, 最大尺寸 800KB。</p>
|
||||
</form>
|
||||
</VCardText>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user