作者 tangxvhui

调试

@@ -49,7 +49,11 @@ func (c *UploadController) UploadImage() { @@ -49,7 +49,11 @@ func (c *UploadController) UploadImage() {
49 49
50 func saveFile(fileData *multipart.FileHeader, fileType string) (hostpath string, err error) { 50 func saveFile(fileData *multipart.FileHeader, fileType string) (hostpath string, err error) {
51 savepath := filepath.Join(config.MConfig.FileSavePath, fileType) 51 savepath := filepath.Join(config.MConfig.FileSavePath, fileType)
52 - os.MkdirAll(savepath, 0777) 52 + err = os.MkdirAll(savepath, 0777)
  53 + if err != nil {
  54 + log.Error("目录创建失败:%s", err)
  55 + return "", err
  56 + }
53 file, err := fileData.Open() 57 file, err := fileData.Open()
54 defer file.Close() 58 defer file.Close()
55 if err != nil { 59 if err != nil {