refactor: IP 定位器增加 BaiduIP138 类型
#Comment 移除 Locator 属性,增加 LocatorFactory 回调与 LocatorName 属性
This commit is contained in:
parent
aea2b8e607
commit
99cbd930c6
|
@ -97,7 +97,7 @@ namespace Bootstrap.DataAccess
|
||||||
if (!string.IsNullOrEmpty(name) && !name.Equals("None", StringComparison.OrdinalIgnoreCase))
|
if (!string.IsNullOrEmpty(name) && !name.Equals("None", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var url = RetrieveLocaleIPSvrUrl(name);
|
var url = RetrieveLocaleIPSvrUrl(name);
|
||||||
op.Locator = DefaultIPLocatorProvider.CreateLocator(name);
|
op.LocatorName = name;
|
||||||
op.Url = string.IsNullOrEmpty(url) ? string.Empty : $"{url}{op.IP}";
|
op.Url = string.IsNullOrEmpty(url) ? string.Empty : $"{url}{op.IP}";
|
||||||
op.Period = RetrieveLocaleIPSvrCachePeriod() * 60 * 1000;
|
op.Period = RetrieveLocaleIPSvrCachePeriod() * 60 * 1000;
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ namespace Bootstrap.Client.DataAccess
|
||||||
if (!string.IsNullOrEmpty(name) && !name.Equals("None", StringComparison.OrdinalIgnoreCase))
|
if (!string.IsNullOrEmpty(name) && !name.Equals("None", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var url = RetrieveLocaleIPSvrUrl(name);
|
var url = RetrieveLocaleIPSvrUrl(name);
|
||||||
op.Locator = DefaultIPLocatorProvider.CreateLocator(name);
|
op.LocatorName = name;
|
||||||
op.Url = string.IsNullOrEmpty(url) ? string.Empty : $"{url}{op.IP}";
|
op.Url = string.IsNullOrEmpty(url) ? string.Empty : $"{url}{op.IP}";
|
||||||
if (int.TryParse(RetrieveLocaleIPSvrCachePeriod(), out var period) && period > 0) op.Period = period * 60 * 1000;
|
if (int.TryParse(RetrieveLocaleIPSvrCachePeriod(), out var period) && period > 0) op.Period = period * 60 * 1000;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue