diff --git a/src/main/java/com/dispose/service/impl/DisposeAbilityRouterServiceImpl.java b/src/main/java/com/dispose/service/impl/DisposeAbilityRouterServiceImpl.java index 37d4a8c3..d256506d 100644 --- a/src/main/java/com/dispose/service/impl/DisposeAbilityRouterServiceImpl.java +++ b/src/main/java/com/dispose/service/impl/DisposeAbilityRouterServiceImpl.java @@ -144,11 +144,19 @@ public class DisposeAbilityRouterServiceImpl implements DisposeAbilityRouterServ @Override public ErrorCode addDisposeAbilityDevice(DisposeDevice dev) { DisposeAbility db; - + String urlSpiltChar = "/"; + String url; String httpType = dev.getUrlType() == HttpType.HTTP ? "http://" : "https://"; String addr = (dev.getIpPort() == null || dev.getIpPort() .length() == 0) ? dev.getIpAddr() : (dev.getIpAddr() + ":" + dev.getIpPort()); - String url = httpType + addr + "/" + dev.getUrlPath(); + + if (dev.getUrlPath().length() == 0) { + url = httpType + addr + urlSpiltChar; + } else if (dev.getUrlPath().endsWith(urlSpiltChar)) { + url = httpType + addr + urlSpiltChar + dev.getUrlPath(); + } else { + url = httpType + addr + urlSpiltChar + dev.getUrlPath() + urlSpiltChar; + } switch (dev.getDeviceType()) { case DPTECH_UMC: