fix 更新配置失效问题

This commit is contained in:
2024-11-24 05:36:30 +08:00
parent 41d3dec536
commit 71d090872d
5 changed files with 17 additions and 11 deletions

View File

@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLDecoder;
@@ -52,7 +53,13 @@ public class VideoFileController {
url = URLDecoder.decode(url, StandardCharsets.UTF_8);
String encode = AppTools.getMD5(url);
File img = new File("cache" + File.separator + "image" + File.separator + encode);
if (img.exists()) {
int length;
try {
length = new URL(url).openConnection().getContentLength();
} catch (IOException e) {
throw new RuntimeException(e);
}
if (img.exists()&&length==img.length()) {
return Tools.getFile(img);
}
if (!img.getParentFile().exists()) {