diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/external/MhFileClient.java b/hz-pm-api/src/main/java/com/hz/pm/api/external/MhFileClient.java index f83283e..11cfeb5 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/external/MhFileClient.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/external/MhFileClient.java @@ -1,11 +1,10 @@ package com.hz.pm.api.external; import cn.hutool.core.io.FileUtil; -import cn.hutool.core.io.IoUtil; import cn.hutool.core.io.resource.ClassPathResource; import cn.hutool.core.lang.TypeReference; -import cn.hutool.core.lang.UUID; import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpUtil; @@ -21,7 +20,6 @@ import org.springframework.stereotype.Component; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; -import java.io.ByteArrayOutputStream; import java.io.File; import java.util.Arrays; import java.util.Collections; @@ -76,7 +74,8 @@ public class MhFileClient { try { List files = listFileInfo(fileId); MhFileInfoDTO file = files.get(0); - String tmpFilePath = FileUtil.getTmpDirPath() + file.getFileName() + "." + file.getFileSuffix(); + String tmpDirPath = StrUtil.appendIfMissing(FileUtil.getTmpDirPath(), "/"); + String tmpFilePath = tmpDirPath + file.getFileName() + "." + file.getFileSuffix(); File tmpFile = new File(tmpFilePath); long size = HttpUtil.downloadFile(fileUrl, tmpFile); log.info("下载文件:{},大小为:{}", fileId, size); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/QxProjectController.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/QxProjectController.java index 084f101..7f96be2 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/QxProjectController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/QxProjectController.java @@ -81,7 +81,7 @@ public class QxProjectController { return qxProjectManage.listReplaceInfo(projectId); } - @PostMapping("importProject") + @PostMapping("/importProject") @ApiOperation("导入项目") @PreAuthorize("hasAuthority('SUPER_ADMIN')") public void importProject(MultipartFile file) {