fix 更新配置失效问题
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user