Browse Source

由于百度查IP的相关API的结果不再精确,故删掉相关功能

懒得勤快 4 years ago
parent
commit
ecabaf5857

+ 0 - 64
Masuit.Tools.Abstractions/Models/AddressComponent.cs

@@ -1,64 +0,0 @@
-using Newtonsoft.Json;
-
-namespace Masuit.Tools.Models
-{
-    /// <summary>
-    /// 地理信息成分
-    /// </summary>
-    public class AddressComponent
-    {
-        /// <summary>
-        /// 国家
-        /// </summary>
-        [JsonProperty("country")]
-        public string Country { get; set; }
-
-        /// <summary>
-        /// 国家代码
-        /// </summary>
-        [JsonProperty("country_code")]
-        public int CountryCode { get; set; }
-
-        /// <summary>
-        /// 省
-        /// </summary>
-        [JsonProperty("province")]
-        public string Province { get; set; }
-
-        /// <summary>
-        /// 市
-        /// </summary>
-        [JsonProperty("city")]
-        public string City { get; set; }
-
-        /// <summary>
-        /// 区
-        /// </summary>
-        [JsonProperty("district")]
-        public string District { get; set; }
-
-        /// <summary>
-        /// 街道
-        /// </summary>
-        [JsonProperty("street")]
-        public string Street { get; set; }
-
-        /// <summary>
-        /// 门牌号
-        /// </summary>
-        [JsonProperty("street_number")]
-        public string StreetNumber { get; set; }
-
-        /// <summary>
-        /// 方位
-        /// </summary>
-        [JsonProperty("direction")]
-        public string Direction { get; set; }
-
-        /// <summary>
-        /// 距离
-        /// </summary>
-        [JsonProperty("distance")]
-        public string Distance { get; set; } = "0";
-    }
-}

+ 0 - 47
Masuit.Tools.Abstractions/Models/AddressResult.cs

@@ -1,47 +0,0 @@
-using Newtonsoft.Json;
-using System.Collections.Generic;
-
-namespace Masuit.Tools.Models
-{
-    /// <summary>
-    /// 返回结果集
-    /// </summary>
-    public class AddressResult
-    {
-        /// <summary>
-        /// 经纬度
-        /// </summary>
-        [JsonProperty("location")]
-        public Location Location { get; set; }
-
-        /// <summary>
-        /// 详细地址
-        /// </summary>
-        [JsonProperty("formatted_address")]
-        public string FormattedAddress { get; set; }
-
-        /// <summary>
-        /// 商业地址
-        /// </summary>
-        [JsonProperty("business")]
-        public string Business { get; set; }
-
-        /// <summary>
-        /// 地理信息成分
-        /// </summary>
-        [JsonProperty("addressComponent")]
-        public AddressComponent AddressComponent { get; set; }
-
-        /// <summary>
-        /// 参考地址
-        /// </summary>
-        [JsonProperty("pois")]
-        public List<Pois> Pois { get; set; } = new List<Pois>();
-
-        /// <summary>
-        /// 语义描述
-        /// </summary>
-        [JsonProperty("sematic_description")]
-        public string SematicDescription { get; set; }
-    }
-}

+ 0 - 64
Masuit.Tools.Abstractions/Models/BaiduIP.cs

@@ -1,64 +0,0 @@
-using Newtonsoft.Json;
-
-namespace Masuit.Tools.Models
-{
-    /// <summary>
-    /// 百度IP接口的信息
-    /// </summary>
-    public class BaiduIP
-    {
-        /// <summary>
-        /// 基本信息
-        /// </summary>
-        [JsonProperty("address")]
-        public string Address { get; set; }
-
-        /// <summary>
-        /// 基本地理信息
-        /// </summary>
-        [JsonProperty("content")]
-        public AddressInfo AddressInfo { get; set; }
-
-        /// <summary>
-        /// 返回状态,0正常,1出错
-        /// </summary>
-        [JsonProperty("status")]
-        public int Status { get; set; }
-    }
-
-    /// <summary>
-    /// 基本地理信息
-    /// </summary>
-    public class AddressInfo
-    {
-        /// <summary>
-        /// 基本地址
-        /// </summary>
-        [JsonProperty("address")]
-        public string Address { get; set; }
-
-        /// <summary>
-        /// 经纬度
-        /// </summary>
-        [JsonProperty("point")]
-        public LatiLongitude LatiLongitude { get; set; }
-    }
-
-    /// <summary>
-    /// 经纬度
-    /// </summary>
-    public class LatiLongitude
-    {
-        /// <summary>
-        /// 经度
-        /// </summary>
-        [JsonProperty("x")]
-        public string X { get; set; }
-
-        /// <summary>
-        /// 纬度
-        /// </summary>
-        [JsonProperty("y")]
-        public string Y { get; set; }
-    }
-}

+ 0 - 16
Masuit.Tools.Abstractions/Models/IspInfo.cs

@@ -1,16 +0,0 @@
-using Newtonsoft.Json;
-
-namespace Masuit.Tools.Models
-{
-    /// <summary>
-    /// ISP信息
-    /// </summary>
-    public class IspInfo
-    {
-        /// <summary>
-        /// 运营商
-        /// </summary>
-        [JsonProperty("wl")]
-        public string ISPName { get; set; }
-    }
-}

+ 0 - 22
Masuit.Tools.Abstractions/Models/Location.cs

@@ -1,22 +0,0 @@
-using Newtonsoft.Json;
-
-namespace Masuit.Tools.Models
-{
-    /// <summary>
-    /// 经纬度
-    /// </summary>
-    public class Location
-    {
-        /// <summary>
-        /// 经度
-        /// </summary>
-        [JsonProperty("lng")]
-        public double Lng { get; set; }
-
-        /// <summary>
-        /// 纬度
-        /// </summary>
-        [JsonProperty("lat")]
-        public double Lat { get; set; }
-    }
-}

+ 0 - 22
Masuit.Tools.Abstractions/Models/PhysicsAddress.cs

@@ -1,22 +0,0 @@
-using Newtonsoft.Json;
-
-namespace Masuit.Tools.Models
-{
-    /// <summary>
-    /// 详细地理信息
-    /// </summary>
-    public class PhysicsAddress
-    {
-        /// <summary>
-        /// 返回状态,0正常,1出错
-        /// </summary>
-        [JsonProperty("status")]
-        public int Status { get; set; }
-
-        /// <summary>
-        /// 返回结果集
-        /// </summary>
-        [JsonProperty("result")]
-        public AddressResult AddressResult { get; set; } = new AddressResult();
-    }
-}

+ 0 - 52
Masuit.Tools.Abstractions/Models/Pois.cs

@@ -1,52 +0,0 @@
-using Newtonsoft.Json;
-
-namespace Masuit.Tools.Models
-{
-    /// <summary>
-    /// 参考位置
-    /// </summary>
-    public class Pois
-    {
-        /// <summary>
-        /// 地理位置详细
-        /// </summary>
-        [JsonProperty("addr")]
-        public string AddressDetail { get; set; }
-
-        /// <summary>
-        /// 方位
-        /// </summary>
-        [JsonProperty("direction")]
-        public string Direction { get; set; }
-
-        /// <summary>
-        /// 距离
-        /// </summary>
-        [JsonProperty("distance")]
-        public string Distance { get; set; } = "0";
-
-        /// <summary>
-        /// 建筑物名字
-        /// </summary>
-        [JsonProperty("name")]
-        public string Name { get; set; }
-
-        /// <summary>
-        /// 建筑物类型
-        /// </summary>
-        [JsonProperty("poiType")]
-        public string PoiType { get; set; }
-
-        /// <summary>
-        /// 经纬度
-        /// </summary>
-        [JsonProperty("point")]
-        public LatiLongitude Point { get; set; }
-
-        /// <summary>
-        /// 标签
-        /// </summary>
-        [JsonProperty("tag")]
-        public string Tag { get; set; }
-    }
-}

+ 0 - 52
Masuit.Tools.Abstractions/Models/TaobaoIP.cs

@@ -1,52 +0,0 @@
-using Newtonsoft.Json;
-
-namespace Masuit.Tools.Models
-{
-    /// <summary>
-    /// 淘宝IP接口信息
-    /// </summary>
-    public class TaobaoIP
-    {
-        /// <summary>
-        /// 返回状态码
-        /// </summary>
-        [JsonProperty("code")]
-        public int Code { get; set; }
-
-        /// <summary>
-        /// 数据
-        /// </summary>
-        [JsonProperty("data")]
-        public IPData IpData { get; set; }
-    }
-
-    /// <summary>
-    /// 淘宝IP接口信息
-    /// </summary>
-    public class IPData
-    {
-        /// <summary>
-        /// 国家
-        /// </summary>
-        [JsonProperty("country")]
-        public string Country { get; set; }
-
-        /// <summary>
-        /// 省
-        /// </summary>
-        [JsonProperty("region")]
-        public string Region { get; set; }
-
-        /// <summary>
-        /// 市
-        /// </summary>
-        [JsonProperty("city")]
-        public string City { get; set; }
-
-        /// <summary>
-        /// ISP
-        /// </summary>
-        [JsonProperty("isp")]
-        public string Isp { get; set; }
-    }
-}

+ 8 - 0
Masuit.Tools.Core/Masuit.Tools.Core.csproj

@@ -73,6 +73,14 @@ github:https://github.com/ldqk/Masuit.Tools
       <Compile Remove="..\Masuit.Tools.Abstractions\Mapping\**" />
     </ItemGroup>
     <ItemGroup>
+      <Compile Remove="..\Masuit.Tools.Abstractions\Models\AddressComponent.cs" />
+      <Compile Remove="..\Masuit.Tools.Abstractions\Models\AddressResult.cs" />
+      <Compile Remove="..\Masuit.Tools.Abstractions\Models\BaiduIP.cs" />
+      <Compile Remove="..\Masuit.Tools.Abstractions\Models\IspInfo.cs" />
+      <Compile Remove="..\Masuit.Tools.Abstractions\Models\Location.cs" />
+      <Compile Remove="..\Masuit.Tools.Abstractions\Models\PhysicsAddress.cs" />
+      <Compile Remove="..\Masuit.Tools.Abstractions\Models\Pois.cs" />
+      <Compile Remove="..\Masuit.Tools.Abstractions\Models\TaobaoIP.cs" />
       <Compile Remove="..\Masuit.Tools.Abstractions\Reflection\ClassHelper.cs" />
     </ItemGroup>
 

+ 1 - 154
Masuit.Tools.Core/Net/WebExtension.cs

@@ -1,14 +1,6 @@
-using Masuit.Tools.Config;
-using Masuit.Tools.Models;
-using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Http;
 using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Linq;
 using System.Linq.Expressions;
-using System.Net.Http;
-using System.Threading;
-using System.Threading.Tasks;
 
 namespace Masuit.Tools.Core.Net
 {
@@ -17,151 +9,6 @@ namespace Masuit.Tools.Core.Net
     /// </summary>
     public static class WebExtension
     {
-        #region 获取客户端IP地址信息
-
-        /// <summary>
-        /// 根据IP地址获取详细地理信息
-        /// </summary>
-        /// <param name="ip"></param>
-        /// <returns></returns>
-        public static async Task<Tuple<string, List<string>>> GetIPAddressInfo(this string ip)
-        {
-            var address = await GetPhysicsAddressInfo(ip);
-            if (address?.Status == 0)
-            {
-                string detail = $"{address.AddressResult.FormattedAddress} {address.AddressResult.AddressComponent.Direction}{address.AddressResult.AddressComponent.Distance ?? "0"}米";
-                var pois = address.AddressResult.Pois.Select(p => $"{p.AddressDetail}{p.Name} {p.Direction}{p.Distance ?? "0"}米").ToList();
-                return new Tuple<string, List<string>>(detail, pois);
-            }
-
-            return new Tuple<string, List<string>>("IP地址不正确", new List<string>());
-        }
-
-        private static readonly HttpClient HttpClient = new HttpClient();
-        private static readonly CancellationTokenSource _cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
-
-        /// <summary>
-        /// 根据IP地址获取详细地理信息对象
-        /// </summary>
-        /// <param name="ip"></param>
-        /// <returns></returns>
-        public static async Task<PhysicsAddress> GetPhysicsAddressInfo(this string ip)
-        {
-            if (!ip.MatchInetAddress())
-            {
-                return null;
-            }
-
-            var ak = ConfigHelper.GetConfigOrDefault("BaiduAK", null) ?? throw new Exception("未配置BaiduAK,请先在您的应用程序appsettings.json中下添加BaiduAK配置节(注意大小写);或手动在程序入口处调用IConfiguration的AddToMasuitTools方法");
-            HttpClient.DefaultRequestHeaders.Referrer = new Uri("http://lbsyun.baidu.com/jsdemo.htm");
-            var ipAddress = await HttpClient.GetAsync($"http://api.map.baidu.com/location/ip?ak={ak}&ip={ip}&coor=bd09ll", _cts.Token).ContinueWith(t =>
-            {
-                if (t.IsCanceled || t.IsFaulted)
-                {
-                    return null;
-                }
-                if (t.Result.IsSuccessStatusCode)
-                {
-                    using var content = t.Result.Content;
-                    return JsonConvert.DeserializeObject<BaiduIP>(content.ReadAsStringAsync().Result);
-                }
-
-                return null;
-            });
-            if (ipAddress?.Status == 0)
-            {
-                var point = ipAddress.AddressInfo.LatiLongitude;
-                var result = await HttpClient.GetAsync($"http://api.map.baidu.com/geocoder/v2/?location={point.Y},{point.X}&output=json&pois=1&radius=1000&latest_admin=1&coordtype=bd09ll&ak={ak}", _cts.Token).ContinueWith(t =>
-                {
-                    if (t.IsCanceled || t.IsFaulted)
-                    {
-                        return null;
-                    }
-                    if (t.Result.IsSuccessStatusCode)
-                    {
-                        using var content = t.Result.Content;
-                        return JsonConvert.DeserializeObject<PhysicsAddress>(content.ReadAsStringAsync().Result);
-                    }
-
-                    return null;
-                });
-                if (result?.Status == 0)
-                {
-                    return result;
-                }
-            }
-            else
-            {
-                var taobaoIp = await HttpClient.GetAsync($"http://ip.taobao.com/service/getIpInfo.php?ip={ip}", _cts.Token).ContinueWith(t =>
-                {
-                    if (t.IsCanceled || t.IsFaulted)
-                    {
-                        return null;
-                    }
-                    if (t.Result.IsSuccessStatusCode)
-                    {
-                        using var content = t.Result.Content;
-                        return JsonConvert.DeserializeObject<TaobaoIP>(content.ReadAsStringAsync().Result);
-                    }
-
-                    return null;
-                });
-                if (taobaoIp?.Code == 0)
-                {
-                    return new PhysicsAddress()
-                    {
-                        Status = 0,
-                        AddressResult = new AddressResult()
-                        {
-                            FormattedAddress = taobaoIp.IpData.Country + taobaoIp.IpData.Region + taobaoIp.IpData.City,
-                            AddressComponent = new AddressComponent()
-                            {
-                                Province = taobaoIp.IpData.Region
-                            },
-                            Pois = new List<Pois>()
-                        }
-                    };
-                }
-            }
-
-            return null;
-        }
-
-        /// <summary>
-        /// 根据IP地址获取ISP
-        /// </summary>
-        /// <param name="ip"></param>
-        /// <returns></returns>
-        public static string GetISP(this string ip)
-        {
-            if (!ip.MatchInetAddress())
-            {
-                return $"{ip}不是一个合法的IP";
-            }
-
-            var task = HttpClient.GetAsync($"http://ip.taobao.com/service/getIpInfo.php?ip={ip}", _cts.Token).ContinueWith(t =>
-             {
-                 if (t.IsCanceled || t.IsFaulted)
-                 {
-                     return $"未能找到{ip}的ISP信息";
-                 }
-                 if (t.Result.IsSuccessStatusCode)
-                 {
-                     using var content = t.Result.Content;
-                     var taobaoIp = JsonConvert.DeserializeObject<TaobaoIP>(content.ReadAsStringAsync().Result);
-                     if (taobaoIp.Code == 0)
-                     {
-                         return taobaoIp.IpData.Isp;
-                     }
-                 }
-
-                 return $"未能找到{ip}的ISP信息";
-             });
-            return task.Result;
-        }
-
-        #endregion 获取客户端IP地址信息
-
         /// <summary>
         /// 写Session
         /// </summary>

+ 0 - 24
Masuit.Tools.Net45/Masuit.Tools.Net45.csproj

@@ -166,15 +166,6 @@
     <Compile Include="..\Masuit.Tools.Abstractions\Mime\MimeMappingItem.cs">
       <Link>Mime\MimeMappingItem.cs</Link>
     </Compile>
-    <Compile Include="..\Masuit.Tools.Abstractions\Models\AddressComponent.cs">
-      <Link>Models\AddressComponent.cs</Link>
-    </Compile>
-    <Compile Include="..\Masuit.Tools.Abstractions\Models\AddressResult.cs">
-      <Link>Models\AddressResult.cs</Link>
-    </Compile>
-    <Compile Include="..\Masuit.Tools.Abstractions\Models\BaiduIP.cs">
-      <Link>Models\BaiduIP.cs</Link>
-    </Compile>
     <Compile Include="..\Masuit.Tools.Abstractions\Models\DateTimeRange.cs">
       <Link>Models\DateTimeRange.cs</Link>
     </Compile>
@@ -184,27 +175,12 @@
     <Compile Include="..\Masuit.Tools.Abstractions\Models\EmailAddress.cs">
       <Link>Models\EmailAddress.cs</Link>
     </Compile>
-    <Compile Include="..\Masuit.Tools.Abstractions\Models\IspInfo.cs">
-      <Link>Models\IspInfo.cs</Link>
-    </Compile>
     <Compile Include="..\Masuit.Tools.Abstractions\Models\ITree.cs">
       <Link>Models\ITree.cs</Link>
     </Compile>
-    <Compile Include="..\Masuit.Tools.Abstractions\Models\Location.cs">
-      <Link>Models\Location.cs</Link>
-    </Compile>
     <Compile Include="..\Masuit.Tools.Abstractions\Models\PagedList.cs">
       <Link>Models\PagedList.cs</Link>
     </Compile>
-    <Compile Include="..\Masuit.Tools.Abstractions\Models\PhysicsAddress.cs">
-      <Link>Models\PhysicsAddress.cs</Link>
-    </Compile>
-    <Compile Include="..\Masuit.Tools.Abstractions\Models\Pois.cs">
-      <Link>Models\Pois.cs</Link>
-    </Compile>
-    <Compile Include="..\Masuit.Tools.Abstractions\Models\TaobaoIP.cs">
-      <Link>Models\TaobaoIP.cs</Link>
-    </Compile>
     <Compile Include="..\Masuit.Tools.Abstractions\Models\Tree.cs">
       <Link>Models\Tree.cs</Link>
     </Compile>

+ 1 - 153
Masuit.Tools/Net/WebExtension.cs

@@ -1,16 +1,9 @@
-using Masuit.Tools.Config;
-using Masuit.Tools.Logging;
-using Masuit.Tools.Models;
+using Masuit.Tools.Logging;
 using Masuit.Tools.NoSQL;
 using Masuit.Tools.Security;
-using Newtonsoft.Json;
 using System;
-using System.Collections.Generic;
 using System.Linq;
-using System.Net.Http;
 using System.Runtime.Remoting.Messaging;
-using System.Threading;
-using System.Threading.Tasks;
 using System.Web;
 using System.Web.SessionState;
 
@@ -368,150 +361,5 @@ namespace Masuit.Tools.Net
         }
 
         #endregion
-
-        #region 获取客户端IP地址信息
-
-        /// <summary>
-        /// 根据IP地址获取详细地理信息
-        /// </summary>
-        /// <param name="ip"></param>
-        /// <returns></returns>
-        public static async Task<Tuple<string, List<string>>> GetIPAddressInfo(this string ip)
-        {
-            var address = await GetPhysicsAddressInfo(ip);
-            if (address?.Status == 0)
-            {
-                string detail = $"{address.AddressResult.FormattedAddress} {address.AddressResult.AddressComponent.Direction}{address.AddressResult.AddressComponent.Distance ?? "0"}米";
-                var pois = address.AddressResult.Pois.Select(p => $"{p.AddressDetail}{p.Name} {p.Direction}{p.Distance ?? "0"}米").ToList();
-                return new Tuple<string, List<string>>(detail, pois);
-            }
-
-            return new Tuple<string, List<string>>("IP地址不正确", new List<string>());
-        }
-
-        private static readonly HttpClient HttpClient = new HttpClient();
-        private static readonly CancellationTokenSource _cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
-
-        /// <summary>
-        /// 根据IP地址获取详细地理信息对象
-        /// </summary>
-        /// <param name="ip"></param>
-        /// <returns></returns>
-        public static async Task<PhysicsAddress> GetPhysicsAddressInfo(this string ip)
-        {
-            if (!ip.MatchInetAddress())
-            {
-                return null;
-            }
-
-            var ak = ConfigHelper.GetConfigOrDefault("BaiduAK", null) ?? throw new Exception("未配置BaiduAK,请先在您的应用程序appsettings.json中下添加BaiduAK配置节(注意大小写);或手动在程序入口处调用IConfiguration的AddToMasuitTools方法");
-            HttpClient.DefaultRequestHeaders.Referrer = new Uri("http://lbsyun.baidu.com/jsdemo.htm");
-            var ipAddress = await HttpClient.GetAsync($"http://api.map.baidu.com/location/ip?ak={ak}&ip={ip}&coor=bd09ll", _cts.Token).ContinueWith(t =>
-            {
-                if (t.IsCanceled || t.IsFaulted)
-                {
-                    return null;
-                }
-                if (t.Result.IsSuccessStatusCode)
-                {
-                    using var content = t.Result.Content;
-                    return JsonConvert.DeserializeObject<BaiduIP>(content.ReadAsStringAsync().Result);
-                }
-
-                return null;
-            });
-            if (ipAddress?.Status == 0)
-            {
-                var point = ipAddress.AddressInfo.LatiLongitude;
-                var result = await HttpClient.GetAsync($"http://api.map.baidu.com/geocoder/v2/?location={point.Y},{point.X}&output=json&pois=1&radius=1000&latest_admin=1&coordtype=bd09ll&ak={ak}", _cts.Token).ContinueWith(t =>
-                {
-                    if (t.IsCanceled || t.IsFaulted)
-                    {
-                        return null;
-                    }
-                    if (t.Result.IsSuccessStatusCode)
-                    {
-                        using var content = t.Result.Content;
-                        return JsonConvert.DeserializeObject<PhysicsAddress>(content.ReadAsStringAsync().Result);
-                    }
-
-                    return null;
-                });
-                if (result?.Status == 0)
-                {
-                    return result;
-                }
-            }
-            else
-            {
-                var taobaoIp = await HttpClient.GetAsync($"http://ip.taobao.com/service/getIpInfo.php?ip={ip}", _cts.Token).ContinueWith(t =>
-                {
-                    if (t.IsCanceled || t.IsFaulted)
-                    {
-                        return null;
-                    }
-                    if (t.Result.IsSuccessStatusCode)
-                    {
-                        using var content = t.Result.Content;
-                        return JsonConvert.DeserializeObject<TaobaoIP>(content.ReadAsStringAsync().Result);
-                    }
-
-                    return null;
-                });
-                if (taobaoIp?.Code == 0)
-                {
-                    return new PhysicsAddress()
-                    {
-                        Status = 0,
-                        AddressResult = new AddressResult()
-                        {
-                            FormattedAddress = taobaoIp.IpData.Country + taobaoIp.IpData.Region + taobaoIp.IpData.City,
-                            AddressComponent = new AddressComponent()
-                            {
-                                Province = taobaoIp.IpData.Region
-                            },
-                            Pois = new List<Pois>()
-                        }
-                    };
-                }
-            }
-
-            return null;
-        }
-
-        /// <summary>
-        /// 根据IP地址获取ISP
-        /// </summary>
-        /// <param name="ip"></param>
-        /// <returns></returns>
-        public static string GetISP(this string ip)
-        {
-            if (!ip.MatchInetAddress())
-            {
-                return $"{ip}不是一个合法的IP";
-            }
-
-            var task = HttpClient.GetAsync($"http://ip.taobao.com/service/getIpInfo.php?ip={ip}", _cts.Token).ContinueWith(t =>
-             {
-                 if (t.IsCanceled || t.IsFaulted)
-                 {
-                     return null;
-                 }
-                 if (t.Result.IsSuccessStatusCode)
-                 {
-                     using var content = t.Result.Content;
-                     var taobaoIp = JsonConvert.DeserializeObject<TaobaoIP>(content.ReadAsStringAsync().Result);
-                     if (taobaoIp.Code == 0)
-                     {
-                         return taobaoIp.IpData.Isp;
-                     }
-                 }
-
-                 return $"未能找到{ip}的ISP信息";
-             });
-            return task.Result;
-        }
-
-        #endregion 获取客户端IP地址信息
     }
 }