diff --git a/renren-admin/src/main/java/io/renren/modules/warningList/controller/ShangTangWarningController.java b/renren-admin/src/main/java/io/renren/modules/warningList/controller/ShangTangWarningController.java index 6e3cca03..347e853a 100644 --- a/renren-admin/src/main/java/io/renren/modules/warningList/controller/ShangTangWarningController.java +++ b/renren-admin/src/main/java/io/renren/modules/warningList/controller/ShangTangWarningController.java @@ -85,11 +85,12 @@ public class ShangTangWarningController { event.setLongitude(camera.getBigDecimal("longitude")); } JSONObject image = jsonObject.getJSONObject("image"); - if(image==null){ - }else{ + // 用nginx转发解决跨域,使用相对路径(假设对方地址不变) + if(image != null){ String images = image.getString("imageUrl"); - String all = images.replaceAll(images.substring(19, 26), "7:8070"); - event.setImageUrl(all); + if (images != null) { + event.setImageUrl(images.replace("http://10.132.191.47:30080", "")); + } } event.setTaskId(jsonObject.getString("taskId"));