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 }