diff --git a/src/modules/rdb/http/router_tree.go b/src/modules/rdb/http/router_tree.go index a2b9aca9..aa7b67f8 100644 --- a/src/modules/rdb/http/router_tree.go +++ b/src/modules/rdb/http/router_tree.go @@ -80,6 +80,15 @@ func treeUntilLeafGets(c *gin.Context) { if strings.Contains(ret[i].Path, arr[0]) { pathSet[ret[i].Path] = struct{}{} } + + // 根据节点名搜索 + if strings.Contains(ret[i].Name, arr[0]) { + for j := 0; j < cnt; j++ { + if strings.HasPrefix(ret[j].Path, ret[i].Path) { + pathSet[ret[j].Path] = struct{}{} + } + } + } } } } else { @@ -90,6 +99,15 @@ func treeUntilLeafGets(c *gin.Context) { if !strings.Contains(ret[i].Path, arr[j]) { match = false } + + // 根据节点名搜索 + if strings.Contains(ret[i].Name, arr[j]) { + for k := 0; k < cnt; k++ { + if strings.HasPrefix(ret[k].Path, ret[i].Path) { + pathSet[ret[k].Path] = struct{}{} + } + } + } } if match {