diff --git a/aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/AbpDaprClientBuilderOptions.cs b/aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/AbpDaprClientBuilderOptions.cs index 4a02e419f..5e2227b63 100644 --- a/aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/AbpDaprClientBuilderOptions.cs +++ b/aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/AbpDaprClientBuilderOptions.cs @@ -1,22 +1,22 @@ -using Dapr.Client; -using System; -using System.Collections.Generic; - -namespace LINGYUN.Abp.Dapr.Client -{ - public class AbpDaprClientBuilderOptions - { - public List> ProxyClientActions { get; } - - public List> ProxyClientBuildActions { get; } - - internal HashSet ConfiguredProxyClients { get; } - - public AbpDaprClientBuilderOptions() - { - ConfiguredProxyClients = new HashSet(); - ProxyClientActions = new List>(); - ProxyClientBuildActions = new List>(); - } - } -} +using Dapr.Client; +using System; +using System.Collections.Generic; + +namespace LINGYUN.Abp.Dapr.Client +{ + public class AbpDaprClientBuilderOptions + { + public List> ProxyClientActions { get; } + + public List> ProxyClientBuildActions { get; } + + internal HashSet ConfiguredProxyClients { get; } + + public AbpDaprClientBuilderOptions() + { + ConfiguredProxyClients = new HashSet(); + ProxyClientActions = new List>(); + ProxyClientBuildActions = new List>(); + } + } +} diff --git a/aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/AbpDaprClientProxyOptions.cs b/aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/AbpDaprClientProxyOptions.cs index 6466c55b7..94a0167d8 100644 --- a/aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/AbpDaprClientProxyOptions.cs +++ b/aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/AbpDaprClientProxyOptions.cs @@ -1,15 +1,24 @@ -using System; -using System.Collections.Generic; - -namespace LINGYUN.Abp.Dapr.Client.DynamicProxying -{ - public class AbpDaprClientProxyOptions - { - public Dictionary DaprClientProxies { get; set; } - - public AbpDaprClientProxyOptions() - { - DaprClientProxies = new Dictionary(); - } - } -} +using System; +using System.Collections.Generic; +using System.Net.Http; + +namespace LINGYUN.Abp.Dapr.Client.DynamicProxying +{ + public class AbpDaprClientProxyOptions + { + public Dictionary DaprClientProxies { get; set; } + + /// + /// 增加一个可配置的请求消息 + /// 参数一: appId + /// 参数二: HttpRequestMessage + /// + public List> ProxyRequestActions { get; } + + public AbpDaprClientProxyOptions() + { + DaprClientProxies = new Dictionary(); + ProxyRequestActions = new List>(); + } + } +} diff --git a/aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyInterceptor.cs b/aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyInterceptor.cs index b7c24c5fe..937cecd20 100644 --- a/aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyInterceptor.cs +++ b/aspnet-core/modules/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyInterceptor.cs @@ -212,6 +212,11 @@ namespace LINGYUN.Abp.Dapr.Client.DynamicProxying { requestMessage.Headers.Authorization = httpClient.DefaultRequestHeaders.Authorization; } + // 增加一个可配置的请求消息 + foreach (var clientRequestAction in ClientProxyOptions.ProxyRequestActions) + { + clientRequestAction(remoteServiceConfig.AppId, requestMessage); + } var response = await daprClient.InvokeMethodWithResponseAsync(requestMessage, GetCancellationToken());