Browse Source

fix:#769

main
songzhibin97 3 years ago
parent
commit
1dbfd930fb
  1. 5
      server/utils/file_operations.go

5
server/utils/file_operations.go

@ -1,6 +1,7 @@
package utils package utils
import ( import (
"errors"
"os" "os"
"path/filepath" "path/filepath"
"reflect" "reflect"
@ -25,6 +26,10 @@ func FileMove(src string, dst string) (err error) {
if err != nil { if err != nil {
return err return err
} }
_, err = os.Stat(dst)
if err == nil {
return errors.New("文件已存在")
}
var revoke = false var revoke = false
dir := filepath.Dir(dst) dir := filepath.Dir(dst)
Redirect: Redirect:

Loading…
Cancel
Save