内网访问图片

This commit is contained in:
guoshengxiong 2024-06-20 18:45:01 +08:00
parent 94f4d6cddc
commit e255264a01
2 changed files with 12 additions and 1 deletions

View File

@ -206,6 +206,12 @@ public class HikvisionCall {
@Lazy
@Autowired
private ISystemUserService systemUserService;
private static String xingzongIscIpPort;
@Value("${xingzongIscIpPort:}")
public void setXingzongIscIpPort(String xingzongIscIpPort) {
HikvisionCall.xingzongIscIpPort = xingzongIscIpPort;
}
/**
* 获取图片
@ -229,7 +235,11 @@ public class HikvisionCall {
JSONObject rsJo = JSONObject.parseObject(rs);
String code = rsJo.getString("code");
if (Objects.equals(code, "0")) {
return rsJo.getJSONObject("data").getString("picUrl");
String picUrl = rsJo.getJSONObject("data").getString("picUrl");
if (EnvironmentUtil.isXingZong()) {
picUrl = picUrl.replaceAll("^https:\\/\\/[^/]+\\/", xingzongIscIpPort);
}
return picUrl;
}
return null;
}

View File

@ -73,3 +73,4 @@ spring.datasource.db2.jdbc-url=jdbc:mysql://127.0.0.1:3306/wflow_pro?useUnicode=
spring.datasource.db2.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.db2.username=root
spring.datasource.db2.password=JXJ@admin
xingzongIscIpPort=https://10.168.1.100:6113/