feat: 凭证上传的图片加了大小限制,10mb

This commit is contained in:
hhm 2025-11-27 10:30:15 +08:00
parent 3c03eaf353
commit e99febec4e

View File

@ -148,6 +148,7 @@
list-type="image-card"
:max="1"
accept="image/png,image/jpeg,image/jpg"
@before-upload="beforeUpload"
@finish="handleUploadFinish"
@remove="deleteUpload"
>
@ -312,6 +313,16 @@ const deleteUpload = () => {
uploadedFile.value = ''
}
const beforeUpload = (data) => {
const file = data.file.file
const isLt10M = file.size / 1024 / 1024 < 10
if (!isLt10M) {
message.error('图片大小不能超过10MB请重新上传')
return false
}
return true
}
//
function handleUploadSubmit() {
if (!isFormValid.value) {