feat: upload file size limit change

This commit is contained in:
louis 2024-04-07 16:29:21 +08:00
parent 6efecddde8
commit b86d12199a
1 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@
@cancel="onCancel" @cancel="onCancel"
> >
<a-flex justify="space-between" align="center"> <a-flex justify="space-between" align="center">
<a-alert message="单个文件不超过2MB最多只能上传10个文件" type="info" show-icon /> <a-alert message="单个文件不超过30MB最多只能上传10个文件" type="info" show-icon />
<a-upload :multiple="true" :before-upload="beforeUpload" :show-upload-list="false"> <a-upload :multiple="true" :before-upload="beforeUpload" :show-upload-list="false">
<a-button type="primary"> 选择文件 </a-button> <a-button type="primary"> 选择文件 </a-button>
</a-upload> </a-upload>
@ -88,8 +88,8 @@
}; };
const beforeUpload: UploadProps['beforeUpload'] = async (file) => { const beforeUpload: UploadProps['beforeUpload'] = async (file) => {
if (file.size / 1024 / 1024 > 2) { if (file.size / 1024 / 1024 > 30) {
message.error('单个文件不超过2MB'); message.error('单个文件不超过30MB');
} else { } else {
const item: FileItem = { const item: FileItem = {
file, file,