商汤算法图片解决跨域问题

This commit is contained in:
huangweixiong 2022-06-10 14:45:39 +08:00
parent a0749f2573
commit a5acf77073
1 changed files with 5 additions and 4 deletions

View File

@ -85,11 +85,12 @@ public class ShangTangWarningController {
event.setLongitude(camera.getBigDecimal("longitude")); event.setLongitude(camera.getBigDecimal("longitude"));
} }
JSONObject image = jsonObject.getJSONObject("image"); JSONObject image = jsonObject.getJSONObject("image");
if(image==null){ // 用nginx转发解决跨域使用相对路径假设对方地址不变
}else{ if(image != null){
String images = image.getString("imageUrl"); String images = image.getString("imageUrl");
String all = images.replaceAll(images.substring(19, 26), "7:8070"); if (images != null) {
event.setImageUrl(all); event.setImageUrl(images.replace("http://10.132.191.47:30080", ""));
}
} }
event.setTaskId(jsonObject.getString("taskId")); event.setTaskId(jsonObject.getString("taskId"));