From 8ae367049bd41d8690ffb03bfce48cd2ef5009d6 Mon Sep 17 00:00:00 2001 From: truthhun <1272881215@qq.com> Date: Sun, 12 Mar 2023 10:28:58 +0800 Subject: [PATCH] fix bug --- biz/attachment.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/biz/attachment.go b/biz/attachment.go index 8edf2b8..e5f80fa 100644 --- a/biz/attachment.go +++ b/biz/attachment.go @@ -213,7 +213,6 @@ func (s *AttachmentAPIService) UploadDocument(ctx *gin.Context) { attachment, err := s.saveFile(ctx, fileheader, true) if err != nil { - os.Remove("." + attachment.Path) ctx.JSON(http.StatusInternalServerError, ginResponse{Code: http.StatusInternalServerError, Message: err.Error(), Error: err.Error()}) return } @@ -310,7 +309,6 @@ func (s *AttachmentAPIService) UploadArticle(ctx *gin.Context) { attachment, err := s.saveFile(ctx, fileHeader) if err != nil { s.logger.Error("saveFile", zap.Error(err)) - os.Remove("." + attachment.Path) ctx.JSON(http.StatusOK, map[string]interface{}{"errno": 1, "msg": err.Error()}) return }