diff --git a/Tiobon.Core.Api/Controllers/BaseController.cs b/Tiobon.Core.Api/Controllers/BaseController.cs index b9c67587..51e9f711 100644 --- a/Tiobon.Core.Api/Controllers/BaseController.cs +++ b/Tiobon.Core.Api/Controllers/BaseController.cs @@ -2,7 +2,7 @@ namespace Tiobon.Core.Controllers { - public class BaseController : Controller + public class BaseController : Controller { #region 初始化 protected IServiceBase _service; diff --git a/Tiobon.Core.Api/Controllers/Ghra_GradeController.cs b/Tiobon.Core.Api/Controllers/Ghra_GradeController.cs index 4d115093..f7e9bff9 100644 --- a/Tiobon.Core.Api/Controllers/Ghra_GradeController.cs +++ b/Tiobon.Core.Api/Controllers/Ghra_GradeController.cs @@ -6,7 +6,7 @@ [Route("api/[controller]")] [ApiController, GlobalActionFilter] [Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Ghra)] - public class Ghra_GradeController : BaseController + public class Ghra_GradeController : BaseController { public Ghra_GradeController(IGhra_GradeServices service) : base(service) { diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index 3559a6cf..93434ad1 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -4,7 +4,7 @@ Tiobon.Core.Api - + diff --git a/Tiobon.Core.Common/DB/Aop/SqlsugarAop.cs b/Tiobon.Core.Common/DB/Aop/SqlsugarAop.cs index 7a865f07..0fa51e1b 100644 --- a/Tiobon.Core.Common/DB/Aop/SqlsugarAop.cs +++ b/Tiobon.Core.Common/DB/Aop/SqlsugarAop.cs @@ -96,7 +96,7 @@ public static class SqlSugarAop if (App.User?.ID > 0 && dyCreateBy != null && dyCreateBy.GetValue(entityInfo.EntityValue) == null) dyCreateBy.SetValue(entityInfo.EntityValue, (int)App.User.ID); - if (dyCreateTime != null && dyCreateTime.GetValue(entityInfo.EntityValue) != null && (DateTime)dyCreateTime.GetValue(entityInfo.EntityValue) == DateTime.MinValue) + if ((dyCreateTime != null && dyCreateTime.GetValue(entityInfo.EntityValue) is null) || (dyCreateTime != null && dyCreateTime.GetValue(entityInfo.EntityValue) != null && (DateTime)dyCreateTime.GetValue(entityInfo.EntityValue) == DateTime.MinValue)) dyCreateTime.SetValue(entityInfo.EntityValue, DateTime.Now); break; diff --git a/Tiobon.Core.Services/BASE/BaseServices.cs b/Tiobon.Core.Services/BASE/BaseServices.cs index 9fb96efa..103c195f 100644 --- a/Tiobon.Core.Services/BASE/BaseServices.cs +++ b/Tiobon.Core.Services/BASE/BaseServices.cs @@ -418,12 +418,12 @@ namespace Tiobon.Core.Services.BASE var api = request.Path.ObjToString().TrimEnd('/').ToLower(); var ip = GetUserIp(UserContext.Context); - BasePoco ent = entity as BasePoco; + var entity1 = Mapper.Map(entity).ToANew(); + BasePoco ent = entity1 as BasePoco; ent.CreateIP = ip; ent.CreateProg = api; - var entity1 = Mapper.Map(entity).ToANew(); return await BaseDal.Add(entity1); }