Commit 3f5e885e82953d55cb808624800f302886a11777
1 parent
7d888274
目录默认节点被删除时,重置默认节点为根节点
Showing
5 changed files
with
26 additions
and
2 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
| @@ -415,7 +415,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -415,7 +415,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 415 | 415 | ||
| 416 | Request request = headerProviderPlarformProvider.createNotifyRequest(parentPlatform, catalogXml.toString(), subscribeInfo.getToTag(), subscribeInfo.getFromTag(), callIdHeader); | 416 | Request request = headerProviderPlarformProvider.createNotifyRequest(parentPlatform, catalogXml.toString(), subscribeInfo.getToTag(), subscribeInfo.getFromTag(), callIdHeader); |
| 417 | transmitRequest(parentPlatform, request); | 417 | transmitRequest(parentPlatform, request); |
| 418 | - Thread.sleep(100); | 418 | + Thread.sleep(10); |
| 419 | } catch (SipException | ParseException | InvalidArgumentException e) { | 419 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| 420 | e.printStackTrace(); | 420 | e.printStackTrace(); |
| 421 | return false; | 421 | return false; |
| @@ -459,7 +459,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -459,7 +459,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 459 | 459 | ||
| 460 | Request request = headerProviderPlarformProvider.createNotifyRequest(parentPlatform, catalogXml.toString(), subscribeInfo.getToTag(), subscribeInfo.getFromTag(), callIdHeader); | 460 | Request request = headerProviderPlarformProvider.createNotifyRequest(parentPlatform, catalogXml.toString(), subscribeInfo.getToTag(), subscribeInfo.getFromTag(), callIdHeader); |
| 461 | transmitRequest(parentPlatform, request); | 461 | transmitRequest(parentPlatform, request); |
| 462 | - Thread.sleep(100); | 462 | + Thread.sleep(200); |
| 463 | } catch (SipException | ParseException | InvalidArgumentException e) { | 463 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| 464 | e.printStackTrace(); | 464 | e.printStackTrace(); |
| 465 | return false; | 465 | return false; |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
| @@ -407,6 +407,17 @@ public class PlatformController { | @@ -407,6 +407,17 @@ public class PlatformController { | ||
| 407 | if (logger.isDebugEnabled()) { | 407 | if (logger.isDebugEnabled()) { |
| 408 | logger.debug("删除目录,{}", id); | 408 | logger.debug("删除目录,{}", id); |
| 409 | } | 409 | } |
| 410 | + // 如果删除的是默认目录则根目录设置为默认目录 | ||
| 411 | + PlatformCatalog catalog = storager.getCatalog(id); | ||
| 412 | + if (catalog != null) { | ||
| 413 | + ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(catalog.getPlatformId()); | ||
| 414 | + if (parentPlatform != null) { | ||
| 415 | + if (id.equals(parentPlatform.getCatalogId())) { | ||
| 416 | + storager.setDefaultCatalog(parentPlatform.getServerGBId(), parentPlatform.getServerGBId()); | ||
| 417 | + } | ||
| 418 | + } | ||
| 419 | + } | ||
| 420 | + | ||
| 410 | int delResult = storager.delCatalog(id); | 421 | int delResult = storager.delCatalog(id); |
| 411 | WVPResult<List<PlatformCatalog>> result = new WVPResult<>(); | 422 | WVPResult<List<PlatformCatalog>> result = new WVPResult<>(); |
| 412 | result.setCode(0); | 423 | result.setCode(0); |
src/main/resources/application-dev.yml
src/main/resources/application-docker.yml
web_src/src/components/dialog/chooseChannelForCatalog.vue
| @@ -161,6 +161,9 @@ export default { | @@ -161,6 +161,9 @@ export default { | ||
| 161 | console.log("移除成功") | 161 | console.log("移除成功") |
| 162 | node.parent.loaded = false | 162 | node.parent.loaded = false |
| 163 | node.parent.expand(); | 163 | node.parent.expand(); |
| 164 | + if(this.defaultCatalogId === id) { | ||
| 165 | + this.defaultCatalogId = this.platformId; | ||
| 166 | + } | ||
| 164 | } | 167 | } |
| 165 | }) | 168 | }) |
| 166 | .catch(function (error) { | 169 | .catch(function (error) { |