fix(search): empty parent where update (close #2810)
This commit is contained in:
@ -9,10 +9,10 @@ func IsBalance(str string) bool {
|
||||
}
|
||||
|
||||
// GetActualMountPath remove balance suffix
|
||||
func GetActualMountPath(virtualPath string) string {
|
||||
bIndex := strings.LastIndex(virtualPath, ".balance")
|
||||
func GetActualMountPath(mountPath string) string {
|
||||
bIndex := strings.LastIndex(mountPath, ".balance")
|
||||
if bIndex != -1 {
|
||||
virtualPath = virtualPath[:bIndex]
|
||||
mountPath = mountPath[:bIndex]
|
||||
}
|
||||
return virtualPath
|
||||
return mountPath
|
||||
}
|
||||
|
@ -80,3 +80,7 @@ func JoinBasePath(basePath, reqPath string) (string, error) {
|
||||
}
|
||||
return stdpath.Join(FixAndCleanPath(basePath), FixAndCleanPath(reqPath)), nil
|
||||
}
|
||||
|
||||
func GetFullPath(mountPath, path string) string {
|
||||
return stdpath.Join(GetActualMountPath(mountPath), path)
|
||||
}
|
||||
|
Reference in New Issue
Block a user