From a4df848683363df598e6c859db41fb176fc55cac Mon Sep 17 00:00:00 2001 From: dengbiao Date: Wed, 12 Jun 2024 17:06:20 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=BF=94=E5=9B=9E=E7=BC=A9=E7=95=A5?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/logic/domain/group/model/group.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/logic/domain/group/model/group.go b/internal/logic/domain/group/model/group.go index cc333cb..f5fc5dd 100644 --- a/internal/logic/domain/group/model/group.go +++ b/internal/logic/domain/group/model/group.go @@ -12,6 +12,7 @@ import ( "gim/pkg/pb" "gim/pkg/rpc" "gim/pkg/util" + "strings" "time" "go.uber.org/zap" @@ -374,6 +375,17 @@ func (g *Group) GetMembers(ctx context.Context) ([]*pb.GroupMember, error) { member.AvatarUrl = user.AvatarUrl member.UserExtra = user.Extra } + + //TODO::返回缩略图 + // 检查URL中是否已存在'?' + if strings.Contains(member.AvatarUrl, "?") { + // 如果存在'?',则分割URL和查询参数,并替换查询参数 + parts := strings.Split(member.AvatarUrl, "?") + member.AvatarUrl = parts[0] + "?imageView2/1/w/200/h/200" + } else { + // 如果不存在'?',则直接添加新的查询参数 + member.AvatarUrl += "?imageView2/1/w/200/h/200" + } infos[i] = &member }