Commit 85c17f4563d37cd94c4f5b6b7b4e39e33bd78368

Authored by RuoYi
1 parent c0e7f31f

修复文件上传多级目录识别问题

ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
... ... @@ -146,7 +146,7 @@ public class FileUploadUtils
146 146  
147 147 private static final String getPathFileName(String uploadDir, String fileName) throws IOException
148 148 {
149   - int dirLastIndex = uploadDir.lastIndexOf("/") + 1;
  149 + int dirLastIndex = RuoYiConfig.getProfile().length() + 1;
150 150 String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
151 151 String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
152 152 return pathFileName;
... ...