diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java index 3a0cc8b..6547e4d 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java @@ -3,6 +3,7 @@ package com.ruoyi.common.utils.file; import java.io.*; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Base64; import java.util.List; @@ -380,12 +381,13 @@ public class FileUtils if (!directory.isDirectory()) { throw new ServiceException(folderPath + "is not directory."); } + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); if (directory.isDirectory()) { File[] fileList = directory.listFiles(); assert fileList != null; for (File file : fileList) { if (!file.isDirectory()) { - scanFiles.add(file.getAbsolutePath()); + scanFiles.add(file.getAbsolutePath() + "&" + dateFormat.format(file.lastModified())); } } }