| | |
| | | String problemImage = detail.getProblemImage(); |
| | | if (StringUtils.isNotBlank(problemImage)) { |
| | | JSONArray jsonArray = JSONArray.parseArray(problemImage); |
| | | for (Object o : jsonArray) { |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String downloadUrl = null; |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | // 1 |
| | | String downloadUrl = jsonObject.getString("url");; |
| | | try { |
| | | // 1 |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |