|
@@ -76,7 +76,7 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
if(com.fdkankan.fusion.common.util.StringUtils.isChinese(fileName)){
|
|
if(com.fdkankan.fusion.common.util.StringUtils.isChinese(fileName)){
|
|
throw new BusinessException(ResultCode.UPLOAD_FILE_CHINA_NAME);
|
|
throw new BusinessException(ResultCode.UPLOAD_FILE_CHINA_NAME);
|
|
}
|
|
}
|
|
- if(!fileName.toLowerCase().contains("zip")){
|
|
|
|
|
|
+ if(!fileName.toLowerCase().endsWith(".zip")){
|
|
throw new BusinessException(ResultCode.UPLOAD_FILE_TYPE_ERROR);
|
|
throw new BusinessException(ResultCode.UPLOAD_FILE_TYPE_ERROR);
|
|
}
|
|
}
|
|
//获取文件后缀名
|
|
//获取文件后缀名
|
|
@@ -98,7 +98,7 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
newObjFile.mkdirs();
|
|
newObjFile.mkdirs();
|
|
}
|
|
}
|
|
file.transferTo(newObjFile);
|
|
file.transferTo(newObjFile);
|
|
- if(fileName.toLowerCase().contains("zip")){
|
|
|
|
|
|
+ if(fileName.toLowerCase().endsWith(".zip")){
|
|
ShellUtil.unZip(newObjFile.getPath(),objPath);
|
|
ShellUtil.unZip(newObjFile.getPath(),objPath);
|
|
}
|
|
}
|
|
objPathFile = new File(objPath );
|
|
objPathFile = new File(objPath );
|