From b329034cfc86f1cb200a13d25ec7526716f6d7fa Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Fri, 8 Sep 2023 18:16:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=AE=BE=E7=BD=AE=E5=BD=93=E5=89=8Dlogo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/home-user-auth/internal/logic/userlogolistlogic.go | 7 +++---- server/home-user-auth/internal/logic/userlogosetlogic.go | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/server/home-user-auth/internal/logic/userlogolistlogic.go b/server/home-user-auth/internal/logic/userlogolistlogic.go index 24e6b179..c77cdb85 100644 --- a/server/home-user-auth/internal/logic/userlogolistlogic.go +++ b/server/home-user-auth/internal/logic/userlogolistlogic.go @@ -124,11 +124,10 @@ func (l *UserLogoListLogic) UserLogoList(req *types.UserLogoListReq, userinfo *a } list, err := userMaterialModel.FindList(l.ctx, userMaterialRSB, nil, "") if err != nil { - if errors.Is(err, gorm.ErrRecordNotFound) { - return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "data not found") + if !errors.Is(err, gorm.ErrRecordNotFound) { + logx.Error(err) + return resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to get data list") } - logx.Error(err) - return resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to get data list") } var isDefaul bool = false if len(list) > 0 { diff --git a/server/home-user-auth/internal/logic/userlogosetlogic.go b/server/home-user-auth/internal/logic/userlogosetlogic.go index 99f1e04d..45d5dbf7 100644 --- a/server/home-user-auth/internal/logic/userlogosetlogic.go +++ b/server/home-user-auth/internal/logic/userlogosetlogic.go @@ -122,7 +122,7 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth userInfoFirstRes := BuilderDB.First(userInfo) err = userInfoFirstRes.Error if err != nil { - if errors.Is(err, gorm.ErrRecordNotFound) { + if !errors.Is(err, gorm.ErrRecordNotFound) { logc.Errorf(l.ctx, "userInfo First err:%+v", err) return err }