fix:修复bing获取报错问题 #21
@ -74,6 +74,7 @@ public class ConfigServiceImpl implements ConfigService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String getBingImg() {
|
private String getBingImg() {
|
||||||
|
try {
|
||||||
JSONObject bingObj = HttpUtil.getObj(bingHost + bingUrl, null, false);
|
JSONObject bingObj = HttpUtil.getObj(bingHost + bingUrl, null, false);
|
||||||
String path = bingObj.getJSONArray("images").getJSONObject(0).getString("url");
|
String path = bingObj.getJSONArray("images").getJSONObject(0).getString("url");
|
||||||
String picUrl = bingHost + path;
|
String picUrl = bingHost + path;
|
||||||
@ -85,6 +86,9 @@ public class ConfigServiceImpl implements ConfigService {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("获取bing每日一图错误:{}", e.getLocalizedMessage(), e);
|
log.error("获取bing每日一图错误:{}", e.getLocalizedMessage(), e);
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("获取bing每日一图错误:{}", e.getLocalizedMessage(), e);
|
||||||
|
}
|
||||||
return "/files/public/bing.jpg";
|
return "/files/public/bing.jpg";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user