Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

Commit

Permalink
支持了群晖
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkLeong committed Oct 22, 2021
1 parent 0cafbd5 commit 583ddd0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions webdav/webdav.go
Original file line number Diff line number Diff line change
Expand Up @@ -726,17 +726,19 @@ func (h *Handler) handlePropfind(w http.ResponseWriter, r *http.Request) (status
</D:multistatus>`))
return 0, nil
}
//fmt.Println(string(available))
}
reqPath, status, err := h.stripPrefix(r.URL.Path)
var list model.FileListModel
var fi model.ListModel
if len(reqPath) > 0 && strings.HasSuffix(reqPath, "/") {
fmt.Println(reqPath)
if reqPath == "markdown/" || (len(reqPath) > 0 && strings.HasSuffix(reqPath, "/")) {
dirName := strings.TrimRight(reqPath, "/")
dirName = strings.TrimLeft(dirName, "/")
list, err = aliyun.GetList(h.Config.Token, h.Config.DriveId, "")

strArr := strings.Split(dirName, "/")

fi, _ = findUrl(strArr, h.Config.Token, h.Config.DriveId, list)
list, _ = findList(strArr, h.Config.Token, h.Config.DriveId)

} else if len(reqPath) == 0 {
Expand All @@ -745,6 +747,9 @@ func (h *Handler) handlePropfind(w http.ResponseWriter, r *http.Request) (status
//fmt.Println("获取列表失败")
}
} else if len(reqPath) > 0 && !strings.HasSuffix(reqPath, "/") {
if reqPath == "markdown" {
fmt.Print("markwo")
}
strArr := strings.Split(reqPath, "/")
list, _ := aliyun.GetList(h.Config.Token, h.Config.DriveId, "")
fi, _ = findUrl(strArr, h.Config.Token, h.Config.DriveId, list)
Expand Down

0 comments on commit 583ddd0

Please sign in to comment.