mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-07-18 17:38:07 +08:00
fixed(fs):fixed overwrite functions (#469)
* fixed(fs):fixed overwrite functions
This commit is contained in:
@ -88,6 +88,15 @@ func FsMove(c *gin.Context) {
|
|||||||
common.ErrorResp(c, err, 403)
|
common.ErrorResp(c, err, 403)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !req.Overwrite {
|
||||||
|
for _, name := range req.Names {
|
||||||
|
if res, _ := fs.Get(c, stdpath.Join(dstDir, name), &fs.GetArgs{NoLog: true}); res != nil {
|
||||||
|
common.ErrorStrResp(c, fmt.Sprintf("file [%s] exists", name), 403)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Create all tasks immediately without any synchronous validation
|
// Create all tasks immediately without any synchronous validation
|
||||||
// All validation will be done asynchronously in the background
|
// All validation will be done asynchronously in the background
|
||||||
@ -141,6 +150,15 @@ func FsCopy(c *gin.Context) {
|
|||||||
common.ErrorResp(c, err, 403)
|
common.ErrorResp(c, err, 403)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !req.Overwrite {
|
||||||
|
for _, name := range req.Names {
|
||||||
|
if res, _ := fs.Get(c, stdpath.Join(dstDir, name), &fs.GetArgs{NoLog: true}); res != nil {
|
||||||
|
common.ErrorStrResp(c, fmt.Sprintf("file [%s] exists", name), 403)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Create all tasks immediately without any synchronous validation
|
// Create all tasks immediately without any synchronous validation
|
||||||
// All validation will be done asynchronously in the background
|
// All validation will be done asynchronously in the background
|
||||||
|
Reference in New Issue
Block a user