fix: 修复 pcap 重复上传时删除原始文件问题
This commit is contained in:
@@ -140,10 +140,8 @@ public class PcapServiceImpl extends ServiceImpl<PcapDao, PcapEntity> implements
|
|||||||
entity.setMd5(md5Hex);
|
entity.setMd5(md5Hex);
|
||||||
|
|
||||||
// 根据文件 md5值 判断是否已上存在,存在则响应当前实体
|
// 根据文件 md5值 判断是否已上存在,存在则响应当前实体
|
||||||
PcapEntity findPcapByMd5 = this.getOne(new LambdaQueryWrapper<PcapEntity>().eq(PcapEntity::getMd5, md5Hex));
|
PcapEntity findPcapByMd5 = this.getOne(new LambdaQueryWrapper<PcapEntity>().eq(PcapEntity::getMd5, md5Hex).eq(PcapEntity::getWorkspaceId, workspaceId));
|
||||||
if (T.ObjectUtil.isNotNull(findPcapByMd5)) {
|
if (T.ObjectUtil.isNotNull(findPcapByMd5)) {
|
||||||
// 删除本次记录的文件
|
|
||||||
T.FileUtil.del(destination);
|
|
||||||
return findPcapByMd5;
|
return findPcapByMd5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user