🐛 修复使用本地存储时, 文件名中包含 + 引发的无法下载的 BUG.

This commit is contained in:
zhaojun1998
2020-02-18 20:10:20 +08:00
parent 208da95234
commit 97106383b6
2 changed files with 2 additions and 2 deletions

View File

@@ -37,7 +37,7 @@ public class LocalController {
AntPathMatcher apm = new AntPathMatcher();
String filePath = apm.extractPathWithinPattern(bestMatchPattern, path);
return export(new File(StringUtils.concatPath(localServiceImpl.getFilePath(), URLUtil.decode(filePath))));
return export(new File(StringUtils.concatPath(localServiceImpl.getFilePath(), filePath)));
}
private ResponseEntity<Object> export(File file) {

View File

@@ -90,7 +90,7 @@ public class LocalServiceImpl extends AbstractFileService implements FileService
@Override
public String getDownloadUrl(String path) {
SystemConfig usernameConfig = systemConfigRepository.findByKey(SystemConfigConstant.DOMAIN);
return URLUtil.encode(StringUtils.removeDuplicateSeparator(usernameConfig.getValue() + "/file/" + path));
return StringUtils.removeDuplicateSeparator(usernameConfig.getValue() + "/file/" + path);
}
public String getFilePath() {