|
|
@@ -225,12 +225,13 @@ public class SceneEvidenceServiceImpl extends ServiceImpl<ISceneEvidenceMapper,
|
|
|
//获取到第一张图片
|
|
|
JSONArray medias = data.getJSONArray("media");
|
|
|
JSONObject firstImageObj = medias.stream().findFirst().filter(v -> {
|
|
|
- String type = ((JSONObject) v).getString("type");
|
|
|
+ JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(v));
|
|
|
+ String type = jsonObject.getString("type");
|
|
|
if ("image".equals(type)) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
- }).map(v -> (JSONObject) v).get();
|
|
|
+ }).map(v -> JSON.parseObject(JSON.toJSONString(v))).get();
|
|
|
String fileName = firstImageObj.getString("src");
|
|
|
String imagePath = ossProperties.getAbsolutePath(String.format(UploadFilePath.USER_EDIT_PATH, num)) + fileName;
|
|
|
JSONObject jsonObject = haixinClient.uploadToFdfs(haixinProperties.getHost().concat(haixinProperties.getApi().getFdfsUpload()), imagePath);
|