Skip to content

Commit

Permalink
add: 目录不是4层,从根目录开始
Browse files Browse the repository at this point in the history
  • Loading branch information
cyz-home committed Jul 11, 2023
1 parent 97b508b commit a99906a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions type_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,14 @@ func (b *Query) Handler(entry *logrus.Entry) (*entries, []tag) {
} else if strings.Index(str, QuerySplit) == -1 {
// 第一个非模型目录
arr2 := strings.Split(str, "/")
for i := len(arr2) - 4; i < len(arr2); i++ {
b.File = b.File + "/" + arr2[i]
if len(arr2) >= 4 {
for i := len(arr2) - 4; i < len(arr2); i++ {
b.File = b.File + "/" + arr2[i]
}
} else {
for i := 0; i < len(arr2); i++ {
b.File = b.File + "/" + arr2[i]
}
}
break
}
Expand Down

0 comments on commit a99906a

Please sign in to comment.