|
@@ -46,6 +46,13 @@ function Z3upFiles(
|
|
|
if (e.target.files) {
|
|
|
// 拿到files信息
|
|
|
const filesInfo = e.target.files[0];
|
|
|
+
|
|
|
+ // 校验格式
|
|
|
+ if (!filesInfo.name.includes(".zip")) {
|
|
|
+ e.target.value = "";
|
|
|
+ return MessageFu.warning(`只支持zip格式!`);
|
|
|
+ }
|
|
|
+
|
|
|
// 创建FormData对象
|
|
|
const fd = new FormData();
|
|
|
// 把files添加进FormData对象(‘photo’为后端需要的字段)
|
|
@@ -104,6 +111,7 @@ function Z3upFiles(
|
|
|
<input
|
|
|
id="upInput"
|
|
|
type="file"
|
|
|
+ accept='.zip'
|
|
|
ref={myInput}
|
|
|
onChange={(e) => handeUpPhoto(e)}
|
|
|
/>
|
|
@@ -159,7 +167,7 @@ function Z3upFiles(
|
|
|
</div>
|
|
|
|
|
|
<div className="fileTit" hidden={isLook}>
|
|
|
- 此处的附件为对外的项目成果文件,如程序安装包等,最多支持10个
|
|
|
+ 此处的附件为对外的项目成果文件,仅支持zip格式,最多10个
|
|
|
<br />
|
|
|
<div
|
|
|
className={classNames(
|