[fix] 修改文件管理归档

This commit is contained in:
hhyykk 2024-07-15 21:17:13 +08:00
parent 2b29b12235
commit 705f915efe

View File

@ -11,8 +11,10 @@ import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.*;
@ -189,7 +191,9 @@ public class CategoryServiceImpl implements CategoryService {
Long parentId = 0L;
// 解析路径
String[] categoryElements = path.split("/");
List<String> categoryElements = Arrays.stream(path.split("/"))
.filter(s -> !s.isEmpty())
.toList();
// 根据路径创建文件夹,并返回最后一个文件夹的id
for (String categoryElement : categoryElements) {