Compare commits
No commits in common. "845b1b077e626cc0fb8b95f02b8382130599862a" and "63f1c9a54e2091c7073d6207026435f86db562b6" have entirely different histories.
845b1b077e
...
63f1c9a54e
@ -74,18 +74,14 @@ public class ConfigServiceImpl implements ConfigService {
|
||||
}
|
||||
|
||||
private String getBingImg() {
|
||||
try {
|
||||
JSONObject bingObj = HttpUtil.getObj(bingHost + bingUrl, null, false);
|
||||
String path = bingObj.getJSONArray("images").getJSONObject(0).getString("url");
|
||||
String picUrl = bingHost + path;
|
||||
Request request = new Request.Builder().url(picUrl).build();
|
||||
try (Response res = HttpUtil.getClient(false).newCall(request).execute()) {
|
||||
byte[] bytes = res.body().bytes();
|
||||
String filePath = CommonConstant.fileSavePath + "/files/public/bing.jpg";
|
||||
FileUtil.writeBytes(bytes, filePath);
|
||||
} catch (Exception e) {
|
||||
log.error("获取bing每日一图错误:{}", e.getLocalizedMessage(), e);
|
||||
}
|
||||
JSONObject bingObj = HttpUtil.getObj(bingHost + bingUrl, null, false);
|
||||
String path = bingObj.getJSONArray("images").getJSONObject(0).getString("url");
|
||||
String picUrl = bingHost + path;
|
||||
Request request = new Request.Builder().url(picUrl).build();
|
||||
try (Response res = HttpUtil.getClient(false).newCall(request).execute()) {
|
||||
byte[] bytes = res.body().bytes();
|
||||
String filePath = CommonConstant.fileSavePath + "/files/public/bing.jpg";
|
||||
FileUtil.writeBytes(bytes, filePath);
|
||||
} catch (Exception e) {
|
||||
log.error("获取bing每日一图错误:{}", e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user