mirror of
https://github.com/cloudreve/cloudreve.git
synced 2025-11-02 20:14:02 +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