diff --git a/README.md b/README.md index 62f8b366..8540480d 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Yi框架-一套与SqlSugar一样爽的.Net6低代码开源框架。 适合.Net6学习、Sqlsugar学习 、项目二次开发。 集大成者,终究轮子 -Yi框架最新版本标签:`v1.0.3` 更新时间:2022/4/18 +Yi框架最新版本标签:`v1.0.3` (项目与Sqlsugar同步更新,但这作者老杰哥代码天天爆肝到凌晨两点,我们也尽量会跟上他的脚步。更新频繁,所以可watching持续关注。) diff --git a/Yi.Framework.Net6/Yi.Framework.Common/IOCOptions/ElasticSearchOptions.cs b/Yi.Framework.Net6/Yi.Framework.Common/IOCOptions/ElasticSearchOptions.cs index 1080aaa6..de6c5301 100644 --- a/Yi.Framework.Net6/Yi.Framework.Common/IOCOptions/ElasticSearchOptions.cs +++ b/Yi.Framework.Net6/Yi.Framework.Common/IOCOptions/ElasticSearchOptions.cs @@ -10,5 +10,7 @@ namespace Yi.Framework.Common.IOCOptions { public string Url { get; set; } public string IndexName { get; set; } + public string UserName { get; set; } + public string PassWord { get; set; } } } diff --git a/Yi.Framework.Net6/Yi.Framework.Core/ElasticSearchInvoker.cs b/Yi.Framework.Net6/Yi.Framework.Core/ElasticSearchInvoker.cs index 4b4556cc..da72e72f 100644 --- a/Yi.Framework.Net6/Yi.Framework.Core/ElasticSearchInvoker.cs +++ b/Yi.Framework.Net6/Yi.Framework.Core/ElasticSearchInvoker.cs @@ -16,7 +16,7 @@ namespace Yi.Framework.Core public ElasticSearchInvoker(IOptionsMonitor optionsMonitor) { _elasticSearchOptions = optionsMonitor.CurrentValue; - var settings = new ConnectionSettings(new Uri(_elasticSearchOptions.Url)).DefaultIndex(this._elasticSearchOptions.IndexName); + var settings = new ConnectionSettings(new Uri(_elasticSearchOptions.Url)).DefaultIndex(this._elasticSearchOptions.IndexName).BasicAuthentication(this._elasticSearchOptions.UserName, this._elasticSearchOptions.PassWord); ; Client = new ElasticClient(settings); } private ElasticClient Client;