懒得勤快 3 年之前
父节点
当前提交
cb12c28c70

+ 4 - 4
src/Masuit.MyBlogs.Core/Controllers/ToolsController.cs

@@ -103,8 +103,8 @@ namespace Masuit.MyBlogs.Core.Controllers
                         FormattedAddress = IPAddress.Parse(ip).GetIPLocation().Address,
                         Location = new Location()
                         {
-                            Lng = location.Location.Longitude ?? 0,
-                            Lat = location.Location.Latitude ?? 0
+                            Lng = (decimal)location.Location.Longitude.GetValueOrDefault(),
+                            Lat = (decimal)location.Location.Latitude.GetValueOrDefault()
                         }
                     }
                 };
@@ -148,8 +148,8 @@ namespace Masuit.MyBlogs.Core.Controllers
                         FormattedAddress = IPAddress.Parse(ip).GetIPLocation().Address,
                         Location = new Location()
                         {
-                            Lng = location.Location.Longitude ?? 0,
-                            Lat = location.Location.Latitude ?? 0
+                            Lng = (decimal)location.Location.Longitude.GetValueOrDefault(),
+                            Lat = (decimal)location.Location.Latitude.GetValueOrDefault()
                         }
                     }
                 };

+ 2 - 2
src/Masuit.MyBlogs.Core/Models/ViewModel/PhysicsAddress.cs

@@ -104,12 +104,12 @@ namespace Masuit.Tools.Models
         /// 经度
         /// </summary>
         [JsonProperty("lng")]
-        public double Lng { get; set; }
+        public decimal Lng { get; set; }
 
         /// <summary>
         /// 纬度
         /// </summary>
         [JsonProperty("lat")]
-        public double Lat { get; set; }
+        public decimal Lat { get; set; }
     }
 }