懒得勤快 5 лет назад
Родитель
Сommit
f8e84485cc
1 измененных файлов с 1 добавлено и 8 удалено
  1. 1 8
      src/Masuit.MyBlogs.Core/Extensions/Hangfire/HangfireBackJob.cs

+ 1 - 8
src/Masuit.MyBlogs.Core/Extensions/Hangfire/HangfireBackJob.cs

@@ -138,14 +138,7 @@ namespace Masuit.MyBlogs.Core.Extensions.Hangfire
         {
             RedisHelper.IncrBy("interceptCount");
             var result = s.IP.GetPhysicsAddressInfo().Result;
-            if (result?.Status == 0)
-            {
-                s.Address = result.AddressResult.FormattedAddress;
-            }
-            else
-            {
-                s.Address = s.IP.GetIPLocation();
-            }
+            s.Address = result?.Status == 0 ? result.AddressResult.FormattedAddress : s.IP.GetIPLocation();
             RedisHelper.LPush("intercept", s);
         }