diff --git a/server/home-user-auth/internal/logic/userlogosetlogic.go b/server/home-user-auth/internal/logic/userlogosetlogic.go index 74ee1e6a..230b2af1 100644 --- a/server/home-user-auth/internal/logic/userlogosetlogic.go +++ b/server/home-user-auth/internal/logic/userlogosetlogic.go @@ -149,14 +149,19 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth return err } userInfo.Metadata = &metadataBUserInfo - userInfo.Utime = &nowTime + if userInfo.Id == 0 { // 新增 userInfo.Module = &module + userInfo.Ctime = &nowTime + userInfo.Utime = &nowTime + userInfo.UserId = &userId + userInfo.GuestId = &guestId resCreate := tx.Model(&userInfo).Create(&userInfo) err = resCreate.Error } else { // 更新 + userInfo.Utime = &nowTime resUpdates := tx.Model(&userInfo).Select("metadata").Where("id = ?", userInfo.Id).Updates(&userInfo) err = resUpdates.Error }