zk add client options

This commit is contained in:
Gordon 2023-03-13 13:59:39 +08:00
parent 8a44305440
commit cf29bd6227
2 changed files with 5 additions and 0 deletions

View File

@ -39,6 +39,10 @@ func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) e
func (s *authServer) UserToken(ctx context.Context, req *pbAuth.UserTokenReq) (*pbAuth.UserTokenResp, error) {
log.Info("", "rpc come UserToken")
operationID, ok := ctx.Value(constant.OperationID).(string)
if !ok {
log.Error("2222", "ctx missing operationID", operationID)
}
resp := pbAuth.UserTokenResp{}
if _, err := s.userCheck.GetUserInfo(ctx, req.UserID); err != nil {
log.Info("", "UserToken err:", err.Error())

View File

@ -58,6 +58,7 @@ func rpcClientInterceptor(ctx context.Context, method string, req, reply interfa
}
operationID, ok := ctx.Value(constant.OperationID).(string)
if !ok {
log.Error("1111", "ctx missing operationID")
return errs.ErrArgs.Wrap("ctx missing operationID")
}
md := metadata.Pairs(constant.OperationID, operationID)