From ee6c04fa111542d44561b6a44f0f1c032cb27763 Mon Sep 17 00:00:00 2001 From: zhaojun1998 Date: Sat, 15 Aug 2020 17:48:51 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=20ftp=20=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F,=20=E4=BE=9D=E6=97=A7=E8=8E=B7=E5=8F=96=E5=B0=9D?= =?UTF-8?q?=E8=AF=95=E8=8E=B7=E5=8F=96=20readme=20=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E7=9A=84=20BUG.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../im/zhaojun/zfile/controller/home/FileController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/im/zhaojun/zfile/controller/home/FileController.java b/src/main/java/im/zhaojun/zfile/controller/home/FileController.java index ffd7cfa..fa1ef71 100644 --- a/src/main/java/im/zhaojun/zfile/controller/home/FileController.java +++ b/src/main/java/im/zhaojun/zfile/controller/home/FileController.java @@ -142,12 +142,16 @@ public class FileController { SystemFrontConfigDTO systemConfig = systemConfigService.getSystemFrontConfig(driveId); AbstractBaseFileService fileService = driveContext.get(driveId); + DriveConfig driveConfig = driveConfigService.findById(driveId); String fullPath = StringUtils.removeDuplicateSeparator(path + ZFileConstant.PATH_SEPARATOR + ZFileConstant.README_FILE_NAME); FileItemDTO fileItem = null; try { fileItem = fileService.getFileItem(fullPath); - String readme = HttpUtil.getTextContent(fileItem.getUrl()); - systemConfig.setReadme(readme); + + if (!Objects.equals(driveConfig.getType(), StorageTypeEnum.FTP)) { + String readme = HttpUtil.getTextContent(fileItem.getUrl()); + systemConfig.setReadme(readme); + } } catch (Exception e) { if (e instanceof NotExistFileException) { log.debug("不存在 README 文件, 已跳过, fullPath: {}, fileItem: {}", fullPath, JSON.toJSONString(fileItem));