🎇 finish move api
This commit is contained in:
@ -3,6 +3,7 @@ package file
|
||||
import (
|
||||
"github.com/Xhofe/alist/drivers/base"
|
||||
"github.com/Xhofe/alist/drivers/operate"
|
||||
"github.com/Xhofe/alist/model"
|
||||
"github.com/Xhofe/alist/server/common"
|
||||
"github.com/Xhofe/alist/utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
@ -24,6 +25,10 @@ func Move(c *gin.Context) {
|
||||
common.ErrorStrResp(c, "Empty file names", 400)
|
||||
return
|
||||
}
|
||||
if model.AccountsCount() > 1 && (req.SrcDir == "/" || req.DstDir == "/") {
|
||||
common.ErrorStrResp(c, "Can't operate root folder", 400)
|
||||
return
|
||||
}
|
||||
srcAccount, srcPath, srcDriver, err := common.ParsePath(utils.Join(req.SrcDir, req.Names[0]))
|
||||
if err != nil {
|
||||
common.ErrorResp(c, err, 500)
|
||||
|
Reference in New Issue
Block a user