perf: 优化头像图标不超过10MB

This commit is contained in:
wangdan-fit2cloud 2024-08-07 11:21:46 +08:00
parent 2605d50bd0
commit 889ebe4ed5
4 changed files with 8 additions and 8 deletions

View File

@ -48,10 +48,10 @@ export default {
upload: 'Upload', upload: 'Upload',
default: 'Default Logo', default: 'Default Logo',
custom: 'Custom', custom: 'Custom',
sizeTip: 'Suggested size 32*32, supports jpg, png, gif, size no more than 10 M', sizeTip: 'Suggested size 32*32, supports jpg, png, gif, size no more than 10 MB',
cancel: 'Cancel', cancel: 'Cancel',
save: 'Save', save: 'Save',
fileSizeExceeded: 'File size exceeds 10 M', fileSizeExceeded: 'File size exceeds 10 MB',
setSuccess: 'Setting Successful', setSuccess: 'Setting Successful',
uploadImagePrompt: 'Please upload an image' uploadImagePrompt: 'Please upload an image'
}, },

View File

@ -47,10 +47,10 @@ export default {
upload: '上传', upload: '上传',
default: '默认logo', default: '默认logo',
custom: '自定义', custom: '自定义',
sizeTip: '建议尺寸 32*32支持 JPG、PNG, GIF大小不超过 10 M', sizeTip: '建议尺寸 32*32支持 JPG、PNG, GIF大小不超过 10 MB',
cancel: '取消', cancel: '取消',
save: '保存', save: '保存',
fileSizeExceeded: '文件大小超过 10 M', fileSizeExceeded: '文件大小超过 10 MB',
setSuccess: '设置成功', setSuccess: '设置成功',
uploadImagePrompt: '请上传一张图片' uploadImagePrompt: '请上传一张图片'
}, },

View File

@ -47,7 +47,7 @@
}}</el-button> }}</el-button>
<template #tip> <template #tip>
<div class="el-upload__tip info" style="margin-top: 0"> <div class="el-upload__tip info" style="margin-top: 0">
建议尺寸 32*32支持 JPGPNG, GIF大小不超过 10 M 建议尺寸 32*32支持 JPGPNG, GIF大小不超过 10 MB
</div> </div>
</template> </template>
</el-upload> </el-upload>
@ -84,7 +84,7 @@
}}</el-button> }}</el-button>
<template #tip> <template #tip>
<div class="el-upload__tip info" style="margin-top: 0"> <div class="el-upload__tip info" style="margin-top: 0">
建议尺寸 32*32支持 JPGPNG, GIF大小不超过 10 M 建议尺寸 32*32支持 JPGPNG, GIF大小不超过 10 MB
</div> </div>
</template> </template>
</el-upload> </el-upload>
@ -178,7 +178,7 @@ function resetForm() {
} }
const onChange = (file: any, fileList: UploadFiles, attr: string) => { const onChange = (file: any, fileList: UploadFiles, attr: string) => {
//1 10 M //1 10 MB
const isLimit = file?.size / 1024 / 1024 < 10 const isLimit = file?.size / 1024 / 1024 < 10
if (!isLimit) { if (!isLimit) {
// @ts-ignore // @ts-ignore

View File

@ -103,7 +103,7 @@ const open = (data: any) => {
} }
const onChange = (file: any) => { const onChange = (file: any) => {
//1 10M //110MB
const isLimit = file?.size / 1024 / 1024 < 10 const isLimit = file?.size / 1024 / 1024 < 10
if (!isLimit) { if (!isLimit) {
// @ts-ignore // @ts-ignore