From 01b16bba6832fac0e4f81369fac6a6aa8c6b57a9 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Fri, 24 Nov 2023 15:50:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=88=91=E7=9A=84logo?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/home-user-auth/internal/logic/userlogosetlogic.go | 9 +++++---- .../internal/logic/userlogotemplatetagsetlogic.go | 9 ++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/server/home-user-auth/internal/logic/userlogosetlogic.go b/server/home-user-auth/internal/logic/userlogosetlogic.go index de46d45a..1eedb1ad 100644 --- a/server/home-user-auth/internal/logic/userlogosetlogic.go +++ b/server/home-user-auth/internal/logic/userlogosetlogic.go @@ -187,9 +187,10 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth return err } - userMaterialVrsionData, userMaterialVersionEx := metadataMapOldUserMaterial["version"] - if !userMaterialVersionEx { - userMaterialVrsionData = "" + var templateTagSelectedVersion string + userMaterialVersionData, userMaterialVersionEx := metadataMapOldUserMaterial["version"] + if userMaterialVersionEx { + templateTagSelectedVersion = userMaterialVersionData.(string) } userMaterialTemplateIdTagIds := userMaterialTemplateIdTagIdData.([]interface{}) @@ -200,7 +201,7 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth userMaterialTemplateTagIndex := userMaterialTemplateTag[userMaterialTemplateIdTagId] templateTagSelected := make(map[string]interface{}, 4) - templateTagSelected["version"] = userMaterialVrsionData + templateTagSelected["version"] = templateTagSelectedVersion templateTagSelected["color"] = userMaterialTemplateTagIndex templateTagSelected["template_tag"] = userMaterialTemplateIdTagId templateTagSelected["selected_index"] = 0 diff --git a/server/home-user-auth/internal/logic/userlogotemplatetagsetlogic.go b/server/home-user-auth/internal/logic/userlogotemplatetagsetlogic.go index 55219bcc..23c17749 100644 --- a/server/home-user-auth/internal/logic/userlogotemplatetagsetlogic.go +++ b/server/home-user-auth/internal/logic/userlogotemplatetagsetlogic.go @@ -112,6 +112,12 @@ func (l *UserLogoTemplateTagSetLogic) UserLogoTemplateTagSet(req *types.UserLogo return err } + var templateTagSelectedVersion string + userMaterialVersionData, userMaterialVersionEx := metadataMapOldUserMaterial["version"] + if userMaterialVersionEx { + templateTagSelectedVersion = userMaterialVersionData.(string) + } + userMaterialTemplateTag := userMaterialTemplateTagData.(map[string]interface{}) userMaterialTemplateTagIndex := userMaterialTemplateTag[req.TemplateTag] @@ -121,7 +127,8 @@ func (l *UserLogoTemplateTagSetLogic) UserLogoTemplateTagSet(req *types.UserLogo return err } - templateTagSelected := make(map[string]interface{}, 3) + templateTagSelected := make(map[string]interface{}, 4) + templateTagSelected["version"] = templateTagSelectedVersion templateTagSelected["color"] = userMaterialTemplateTagIndex templateTagSelected["template_tag"] = req.TemplateTag templateTagSelected["selected_index"] = req.TemplateTagColorIndex