diff --git a/server/upload/internal/logic/uploadlogologic.go b/server/upload/internal/logic/uploadlogologic.go index 3983742e..2dc66024 100644 --- a/server/upload/internal/logic/uploadlogologic.go +++ b/server/upload/internal/logic/uploadlogologic.go @@ -247,11 +247,24 @@ func (l *UploadLogoLogic) UploadLogo(req *types.UploadLogoReq, userinfo *auth.Us return err } userInfo.Metadata = &metadataB - logc.Infof(l.ctx, "userInfo %+v", userInfo) if userInfo.Id > 0 { - tx.Select("metadata").Where("id = ?", userInfo.Id).Updates(userInfo) + resUpdates := tx.Select("metadata").Where("id = ?", userInfo.Id).Updates(&userInfo) + err = resUpdates.Error + if err != nil { + if err != gorm.ErrRecordNotFound { + logc.Errorf(l.ctx, "FsUserInfo Updates err:%+v", err) + return err + } + } } else { - tx.Create(userInfo) + resCreate := tx.Create(&userInfo) + err = resCreate.Error + if err != nil { + if err != gorm.ErrRecordNotFound { + logc.Errorf(l.ctx, "FsUserInfo Create err:%+v", err) + return err + } + } } return nil })