moveFiles 修改回无条件 overwrite (Move 或 Rename 都会处罚冲突问题)
This commit is contained in:
parent
e8e38029ca
commit
42f7613bfa
1 changed files with 6 additions and 5 deletions
|
@ -38,13 +38,14 @@ func moveFiles(ctx context.Context, fs *filesystem.FileSystem, src FileInfo, dst
|
|||
fileIDs = []uint{src.(*model.File).ID}
|
||||
}
|
||||
|
||||
if overwrite {
|
||||
if err := _checkOverwriteFile(ctx, fs, src, dst); err != nil {
|
||||
return http.StatusInternalServerError, err
|
||||
}
|
||||
}
|
||||
|
||||
// 判断是否需要移动
|
||||
if src.GetPosition() != path.Dir(dst) {
|
||||
if overwrite {
|
||||
if err := _checkOverwriteFile(ctx, fs, src, dst); err != nil {
|
||||
return http.StatusInternalServerError, err
|
||||
}
|
||||
}
|
||||
err = fs.Move(
|
||||
ctx,
|
||||
folderIDs,
|
||||
|
|
Loading…
Add table
Reference in a new issue