refactor: IP 定位器增加 BaiduIP138 类型

#Comment
移除 Locator 属性,增加 LocatorFactory 回调与 LocatorName 属性
This commit is contained in:
Argo-2016 2020-01-12 16:37:50 +08:00
parent aea2b8e607
commit 99cbd930c6
2 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ namespace Bootstrap.DataAccess
if (!string.IsNullOrEmpty(name) && !name.Equals("None", StringComparison.OrdinalIgnoreCase))
{
var url = RetrieveLocaleIPSvrUrl(name);
op.Locator = DefaultIPLocatorProvider.CreateLocator(name);
op.LocatorName = name;
op.Url = string.IsNullOrEmpty(url) ? string.Empty : $"{url}{op.IP}";
op.Period = RetrieveLocaleIPSvrCachePeriod() * 60 * 1000;
}

View File

@ -124,7 +124,7 @@ namespace Bootstrap.Client.DataAccess
if (!string.IsNullOrEmpty(name) && !name.Equals("None", StringComparison.OrdinalIgnoreCase))
{
var url = RetrieveLocaleIPSvrUrl(name);
op.Locator = DefaultIPLocatorProvider.CreateLocator(name);
op.LocatorName = name;
op.Url = string.IsNullOrEmpty(url) ? string.Empty : $"{url}{op.IP}";
if (int.TryParse(RetrieveLocaleIPSvrCachePeriod(), out var period) && period > 0) op.Period = period * 60 * 1000;
}