fix: the recursive subdirectory moving bug (#4171)
This commit is contained in:
parent
5cba10446e
commit
220fd30830
@ -150,11 +150,12 @@ func FsRecursiveMove(c *gin.Context) {
|
|||||||
for !movingFiles.IsEmpty() {
|
for !movingFiles.IsEmpty() {
|
||||||
|
|
||||||
movingFile := movingFiles.Pop()
|
movingFile := movingFiles.Pop()
|
||||||
movingFilePath := fmt.Sprintf("%s/%s", filePathMap[movingFile], movingFile.GetName())
|
movingFilePath := filePathMap[movingFile]
|
||||||
|
movingFileName := fmt.Sprintf("%s/%s", movingFilePath, movingFile.GetName())
|
||||||
if movingFile.IsDir() {
|
if movingFile.IsDir() {
|
||||||
// directory, recursive move
|
// directory, recursive move
|
||||||
subFilePath := movingFilePath
|
subFilePath := movingFileName
|
||||||
subFiles, err := fs.List(c, subFilePath, &fs.ListArgs{Refresh: true})
|
subFiles, err := fs.List(c, movingFileName, &fs.ListArgs{Refresh: true})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
common.ErrorResp(c, err, 500)
|
common.ErrorResp(c, err, 500)
|
||||||
return
|
return
|
||||||
@ -171,7 +172,7 @@ func FsRecursiveMove(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// move
|
// move
|
||||||
err := fs.Move(c, movingFilePath, dstDir, movingFiles.IsEmpty())
|
err := fs.Move(c, movingFileName, dstDir, movingFiles.IsEmpty())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
common.ErrorResp(c, err, 500)
|
common.ErrorResp(c, err, 500)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user