mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-27 01:30:51 +00:00
修复网路图片保存时文件损坏的情况
This commit is contained in:
parent
e1e1310b9e
commit
353cb8c536
@ -10,6 +10,7 @@ import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.io.*;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
@ -48,6 +49,11 @@ public class FileUtil {
|
||||
out.write(b, 0, n);
|
||||
}
|
||||
|
||||
out.flush();
|
||||
if( ImageIO.read(picFile) == null){
|
||||
picSrc = "/images/default.gif";
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage(),e);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user