Compare commits

...

2 Commits

Author SHA1 Message Date
845b1b077e Merge pull request 'fix:修复bing获取报错问题' (#21) from dev into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #21
2024-05-23 22:08:22 +08:00
fanxb
bb62066b82 fix:修复bing获取报错问题 2024-05-23 22:07:45 +08:00

View File

@ -74,6 +74,7 @@ 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;
@ -85,6 +86,9 @@ public class ConfigServiceImpl implements ConfigService {
} catch (Exception e) {
log.error("获取bing每日一图错误{}", e.getLocalizedMessage(), e);
}
} catch (Exception e) {
log.error("获取bing每日一图错误{}", e.getLocalizedMessage(), e);
}
return "/files/public/bing.jpg";
}