Merge remote-tracking branch 'origin/ver3' into ver3

pull/458/head
withchao 2 years ago
commit 67b195f350

@ -157,6 +157,7 @@ func GinParseToken(rdb redis.UniversalClient) gin.HandlerFunc {
}
} else {
apiresp.GinError(c, errs.ErrTokenNotExist.Wrap())
c.Abort()
return
}
c.Set(constant.OpUserPlatform, constant.PlatformIDToName(claims.PlatformID))

@ -53,6 +53,7 @@ func RpcClientInterceptor(ctx context.Context, method string, req, resp interfac
}
func getRpcContext(ctx context.Context, method string) (context.Context, error) {
// ctx, _ = context.WithTimeout(ctx, time.Second*5)
md := metadata.Pairs()
if keys, _ := ctx.Value(constant.RpcCustomHeader).([]string); len(keys) > 0 {
for _, key := range keys {

@ -7,13 +7,12 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/conversation"
pbConversation "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/conversation"
"google.golang.org/grpc"
)
type Conversation struct {
Client conversation.ConversationClient
Client pbConversation.ConversationClient
conn grpc.ClientConnInterface
discov discoveryregistry.SvcDiscoveryRegistry
}
@ -23,7 +22,7 @@ func NewConversation(discov discoveryregistry.SvcDiscoveryRegistry) *Conversatio
if err != nil {
panic(err)
}
client := conversation.NewConversationClient(conn)
client := pbConversation.NewConversationClient(conn)
return &Conversation{discov: discov, conn: conn, Client: client}
}

Loading…
Cancel
Save