修复 url特殊符号无法下载或者输出问题 修复流接入方法 拼接字符导导致下载或者跨域错误问题

This commit is contained in:
gaoxiongzaq
2024-03-09 10:35:13 +08:00
parent 72014e1534
commit c54610caf6
8 changed files with 65 additions and 22 deletions

View File

@ -105,8 +105,7 @@ public class DownloadUtils {
}
};
try {
URI uri = URI.create(urlStr);
restTemplate.execute(uri, HttpMethod.GET, requestCallback, fileResponse -> {
restTemplate.execute(url.toURI(), HttpMethod.GET, requestCallback, fileResponse -> {
FileUtils.copyToFile(fileResponse.getBody(), realFile);
return null;
});