diff --git a/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs index 573ceb1f9..9936bbb00 100644 --- a/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs +++ b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs @@ -57,7 +57,7 @@ namespace LINGYUN.Abp.Elasticsearch configuration.DefaultFieldNameInferrer((name) => name); } - if (UserName.IsNullOrWhiteSpace()) + if (!UserName.IsNullOrWhiteSpace()) { configuration.BasicAuthentication(UserName, Password); }