mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Modify: use pure tree structure in file system scheme
This commit is contained in:
@@ -13,5 +13,19 @@ func FillSlash(path string) string {
|
||||
return path
|
||||
}
|
||||
return path + "/"
|
||||
|
||||
}
|
||||
|
||||
// SplitPath 分割路径为列表
|
||||
func SplitPath(path string) []string {
|
||||
if len(path) == 0 || path[0] != '/' {
|
||||
return []string{}
|
||||
}
|
||||
|
||||
if path == "/" {
|
||||
return []string{"/"}
|
||||
}
|
||||
|
||||
pathSplit := strings.Split(path, "/")
|
||||
pathSplit[0] = "/"
|
||||
return pathSplit
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user