forked from Gitlink/forgeplus-react
限制文件上传种类
This commit is contained in:
parent
48fc4ce190
commit
d7b879920a
|
@ -66,14 +66,14 @@ function Uploads({ className, size, actionUrl, fileList, showNotification, load,
|
|||
|
||||
function beforeUpload(file) {
|
||||
const isLt100M = file.size / 1024 / 1024 < size;
|
||||
const isMin = file.type === 'rar' || file.type === 'zip';
|
||||
const isMin = file.type === 'application/zip' || file.type === 'application/zip';
|
||||
if (!isLt100M) {
|
||||
showNotification(`文件大小必须小于${size}MB!`);
|
||||
}
|
||||
if (!isMin) {
|
||||
showNotification(`只能上传rar很zip文件`);
|
||||
}
|
||||
return isLt100M;
|
||||
return isLt100M&&isMin;
|
||||
}
|
||||
|
||||
const upload = {
|
||||
|
|
|
@ -413,6 +413,7 @@ export default Form.create()(({ match, history, showNotification, form, current_
|
|||
<Modal
|
||||
title="提交资料"
|
||||
visible={cancelConfirmValue}
|
||||
onOk={()=>{history.go(-1)}}
|
||||
onCancel={() => setCancelConfirmValue(false)}
|
||||
wrapClassName="expert_modal"
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue