fix:设置当前logo

This commit is contained in:
momo 2023-09-08 18:16:19 +08:00
parent dfd3720068
commit b329034cfc
2 changed files with 4 additions and 5 deletions

View File

@ -124,11 +124,10 @@ func (l *UserLogoListLogic) UserLogoList(req *types.UserLogoListReq, userinfo *a
} }
list, err := userMaterialModel.FindList(l.ctx, userMaterialRSB, nil, "") list, err := userMaterialModel.FindList(l.ctx, userMaterialRSB, nil, "")
if err != nil { if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) { if !errors.Is(err, gorm.ErrRecordNotFound) {
return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "data not found") 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 var isDefaul bool = false
if len(list) > 0 { if len(list) > 0 {

View File

@ -122,7 +122,7 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth
userInfoFirstRes := BuilderDB.First(userInfo) userInfoFirstRes := BuilderDB.First(userInfo)
err = userInfoFirstRes.Error err = userInfoFirstRes.Error
if err != nil { if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) { if !errors.Is(err, gorm.ErrRecordNotFound) {
logc.Errorf(l.ctx, "userInfo First err%+v", err) logc.Errorf(l.ctx, "userInfo First err%+v", err)
return err return err
} }