fix: Fix the problem of incorrect judgment error when uploading files

pull/204/head
1379 2 years ago committed by 1379Monitor
parent 014b387bef
commit 5a1b13fd38

@ -147,7 +147,7 @@ func (a *attachmentServiceImpl) Upload(ctx context.Context, fileHeader *multipar
WithStatus(xerr.StatusBadRequest).
WithMsg("附件路径为 " + attachmentDTO.Path + " 已经存在")
}
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) {
if !errors.Is(err, gorm.ErrRecordNotFound) {
return nil, WrapDBErr(err)
}
attachmentEntity := &entity.Attachment{

Loading…
Cancel
Save