Skip to content

Commit a99906a

Browse files
committed
add: 目录不是4层,从根目录开始
1 parent 97b508b commit a99906a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

type_query.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,14 @@ func (b *Query) Handler(entry *logrus.Entry) (*entries, []tag) {
5252
} else if strings.Index(str, QuerySplit) == -1 {
5353
// 第一个非模型目录
5454
arr2 := strings.Split(str, "/")
55-
for i := len(arr2) - 4; i < len(arr2); i++ {
56-
b.File = b.File + "/" + arr2[i]
55+
if len(arr2) >= 4 {
56+
for i := len(arr2) - 4; i < len(arr2); i++ {
57+
b.File = b.File + "/" + arr2[i]
58+
}
59+
} else {
60+
for i := 0; i < len(arr2); i++ {
61+
b.File = b.File + "/" + arr2[i]
62+
}
5763
}
5864
break
5965
}

0 commit comments

Comments
 (0)