ソースを参照

指定API操作记录信息:
RecordAPIOperationMiddleware:注释获取IP地址

Lyyyi 1 日 前
コミット
4d388f457d
共有1 個のファイルを変更した13 個の追加13 個の削除を含む
  1. 13 13
      OASystem/OASystem.Api/Middlewares/RecordAPIOperationMiddleware.cs

+ 13 - 13
OASystem/OASystem.Api/Middlewares/RecordAPIOperationMiddleware.cs

@@ -320,19 +320,19 @@ namespace OASystem.API.Middlewares
         {
             string local = string.Empty;
 
-            if (IPAddress.TryParse(ip,out _))
-            {
-                var response = await _httpClient.GetAsync($"https://api.vore.top/api/IPdata?ip={ip}");
-
-                response.EnsureSuccessStatusCode();
-                var json = await response.Content.ReadAsStringAsync();
-                var ipInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(json);
-                if (ipInfo.code == 200)
-                {
-                    ip = ipInfo.ipinfo.text;
-                    local = $"{ipInfo.adcode.o}";
-                }
-            }
+            //if (IPAddress.TryParse(ip,out _))
+            //{
+            //    var response = await _httpClient.GetAsync($"https://api.vore.top/api/IPdata?ip={ip}");
+
+            //    response.EnsureSuccessStatusCode();
+            //    var json = await response.Content.ReadAsStringAsync();
+            //    var ipInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(json);
+            //    if (ipInfo.code == 200)
+            //    {
+            //        ip = ipInfo.ipinfo.text;
+            //        local = $"{ipInfo.adcode.o}";
+            //    }
+            //}
 
             return (ip, local);
         }