认证-参数导出模板-上传文件限制修改

This commit is contained in:
liyawei
2022-08-24 11:49:22 +08:00
parent 6c8decb9b3
commit 34aa0e1412
@@ -19,11 +19,9 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.multipart.MultipartFile;
import sun.misc.BASE64Encoder;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
@@ -230,14 +228,15 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
throw new JeroBootException("Only upload pdf,word,excel type of file Please select the file again");
}
}
} else if ("2".equals(state)) {
String fileTypeStrTwo = ".doc,.DOC,.docx,.DOCX,.xls, .XLS,.xlsx,.XLSX";
} else if ("2".equals(state)) { // 认证-参数导出模板上传 专用
String fileTypeStrTwo = ".docx,.DOCX,.xlsx,.XLSX";
List<String> fileTypeStrTwoList = Arrays.asList(fileTypeStrTwo.split(","));
//固定文件
if (!fileTypeStrTwo.contains(fileType)) {
if (!fileTypeStrTwoList.contains(fileType)) {
if (cut.equals(CutEnum.CN.getValue())) {
throw new JeroBootException("只能够上传word,excel类型的文件。请重新选择文件!");
throw new JeroBootException("只能够上传.docx,.DOCX,.xlsx,.XLSX后缀类型的文件。请重新选择文件!");
} else {
throw new JeroBootException("Only upload word,excel type of file Please select the file again");
throw new JeroBootException("Only upload .docx,.DOCX,.xlsx,.XLSX suffix type of file Please select the file again");
}
}
} else {