Commit 85c17f4563d37cd94c4f5b6b7b4e39e33bd78368
1 parent
c0e7f31f
修复文件上传多级目录识别问题
Showing
1 changed file
with
1 additions
and
1 deletions
ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
| @@ -146,7 +146,7 @@ public class FileUploadUtils | @@ -146,7 +146,7 @@ public class FileUploadUtils | ||
| 146 | 146 | ||
| 147 | private static final String getPathFileName(String uploadDir, String fileName) throws IOException | 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 | String currentDir = StringUtils.substring(uploadDir, dirLastIndex); | 150 | String currentDir = StringUtils.substring(uploadDir, dirLastIndex); |
| 151 | String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName; | 151 | String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName; |
| 152 | return pathFileName; | 152 | return pathFileName; |