mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 23:42:36 +08:00
🐛 搜索指定路径参数解析异常 Fix https://github.com/siyuan-note/siyuan/issues/6983
This commit is contained in:
parent
5e1d539719
commit
7690ca7c05
@ -201,10 +201,14 @@ func fullTextSearchBlock(c *gin.Context) {
|
|||||||
if nil != pathsArg {
|
if nil != pathsArg {
|
||||||
for _, p := range pathsArg.([]interface{}) {
|
for _, p := range pathsArg.([]interface{}) {
|
||||||
path := p.(string)
|
path := p.(string)
|
||||||
box := strings.Split(path, "/")[0]
|
box := strings.TrimSpace(strings.Split(path, "/")[0])
|
||||||
boxes = append(boxes, box)
|
if "" != box {
|
||||||
path = strings.TrimPrefix(path, box)
|
boxes = append(boxes, box)
|
||||||
paths = append(paths, path)
|
}
|
||||||
|
path = strings.TrimSpace(strings.TrimPrefix(path, box))
|
||||||
|
if "" != path {
|
||||||
|
paths = append(paths, path)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
paths = gulu.Str.RemoveDuplicatedElem(paths)
|
paths = gulu.Str.RemoveDuplicatedElem(paths)
|
||||||
boxes = gulu.Str.RemoveDuplicatedElem(boxes)
|
boxes = gulu.Str.RemoveDuplicatedElem(boxes)
|
||||||
|
Loading…
Reference in New Issue
Block a user