|
@@ -41,10 +41,6 @@ public class SysToolsServiceImpl extends ServiceImpl<SysToolsMapper, SysTools> i
|
|
|
try {
|
|
|
String fileName = FilenameUtils.getName(file.getOriginalFilename());
|
|
|
|
|
|
-// if (!fileName.endsWith(".zip")) {
|
|
|
-// throw ExceptionResultEnum.ERROR.exception("只能上传后缀为[.zip]的文件");
|
|
|
-// }
|
|
|
-
|
|
|
String fileMd5 = DigestUtils.md5Hex(file.getBytes());
|
|
|
if (!Objects.equals(fileMd5, md5)) {
|
|
|
throw ExceptionResultEnum.MD5_EQUALS_FALSE.exception();
|
|
@@ -58,6 +54,7 @@ public class SysToolsServiceImpl extends ServiceImpl<SysToolsMapper, SysTools> i
|
|
|
String filePathName = buildPath(true, UploadFileEnum.FILE.getTitle(), type.name()) + fileName;
|
|
|
FilePathVo filePathVo = fileUploadService.uploadFile(file, UploadFileEnum.FILE, filePathName, fileMd5);
|
|
|
sysTools.setPath(JSON.toJSONString(filePathVo));
|
|
|
+ sysTools.setCreateTime(System.currentTimeMillis());
|
|
|
// 保存或更新
|
|
|
this.saveOrUpdate(sysTools);
|
|
|
} catch (Exception e) {
|