From 37e0d03de197bc260ba766550574166a2f43e4e2 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Fri, 8 Sep 2023 18:26:23 +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/userlogosetlogic.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 }