Skip to content

Commit

Permalink
fix(alist_v3): incorrect src_dir on move and copy (close AlistGo#3121
Browse files Browse the repository at this point in the history
…pr AlistGo#3124)

* fix(alist_v3):add dir check(close AlistGo#3121)

* Update driver.go

Co-authored-by: Noah Hsu <[email protected]>
  • Loading branch information
Panici4 and xhofe authored Jan 22, 2023
1 parent 9b99e8a commit 28875ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/alist_v3/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (d *AListV3) Move(ctx context.Context, srcObj, dstDir model.Obj) error {
SetResult(&resp).
SetHeader("Authorization", d.AccessToken).
SetBody(MoveCopyReq{
SrcDir: srcObj.GetPath(),
SrcDir: path.Dir(srcObj.GetPath()),
DstDir: dstDir.GetPath(),
Names: []string{srcObj.GetName()},
}).Post(url)
Expand All @@ -135,7 +135,7 @@ func (d *AListV3) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {
SetResult(&resp).
SetHeader("Authorization", d.AccessToken).
SetBody(MoveCopyReq{
SrcDir: srcObj.GetPath(),
SrcDir: path.Dir(srcObj.GetPath()),
DstDir: dstDir.GetPath(),
Names: []string{srcObj.GetName()},
}).Post(url)
Expand Down

0 comments on commit 28875ce

Please sign in to comment.