From 2a1d99d167390e81fa663f534f22568249f2d3d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Fri, 26 Jul 2024 22:08:46 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E4=BF=AE=E6=AD=A3=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=97=B6=E4=B8=8A=E4=BC=A0=E7=BC=96=E8=AF=91=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=9A=84=E6=A0=BC=E5=BC=8F=E9=97=AE=E9=A2=98=EF=BC=8C=E9=87=87?= =?UTF-8?q?=E7=94=A8LoginRequest=E7=9A=84UTC=E6=95=B0=E5=AD=97=E6=97=B6?= =?UTF-8?q?=E9=97=B4=EF=BC=8C=E9=81=BF=E5=85=8DJson=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AntJob.Server/Services/AppService.cs | 5 +++-- AntJob.Web/Areas/Ant/Controllers/AppOnlineController.cs | 2 +- AntJob/Models/LoginModel.cs | 4 ++-- AntJob/Providers/AntClient.cs | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/AntJob.Server/Services/AppService.cs b/AntJob.Server/Services/AppService.cs index b492c2e..6dcb19b 100644 --- a/AntJob.Server/Services/AppService.cs +++ b/AntJob.Server/Services/AppService.cs @@ -59,7 +59,8 @@ public AppService(IPasswordProvider passwordProvider, AntJobSetting setting, ILo // 版本和编译时间 if (app.Version.IsNullOrEmpty() || app.Version.CompareTo(model.Version) < 0) app.Version = model.Version; - if (app.CompileTime < model.Compile) app.CompileTime = model.Compile; + var compile = model.Compile.ToDateTime().ToLocalTime(); + if (app.CompileTime < compile) app.CompileTime = compile; if (app.DisplayName.IsNullOrEmpty()) app.DisplayName = model.DisplayName; app.Save(); @@ -69,7 +70,7 @@ public AppService(IPasswordProvider passwordProvider, AntJobSetting setting, ILo online.Name = model.Machine; online.ProcessId = model.ProcessId; online.Version = model.Version; - online.CompileTime = model.Compile; + online.CompileTime = compile; online.Save(); WriteHistory(app, autoReg ? "注册" : "登录", true, $"[{model.Code}/{model.Secret}]在[{model.ClientId}]登录[{app}]成功", ip); diff --git a/AntJob.Web/Areas/Ant/Controllers/AppOnlineController.cs b/AntJob.Web/Areas/Ant/Controllers/AppOnlineController.cs index 6f49c09..265f971 100644 --- a/AntJob.Web/Areas/Ant/Controllers/AppOnlineController.cs +++ b/AntJob.Web/Areas/Ant/Controllers/AppOnlineController.cs @@ -14,7 +14,7 @@ public class AppOnlineController : AntEntityController { static AppOnlineController() { - AppOnline.Meta.Table.DataTable.InsertOnly = true; + //AppOnline.Meta.Table.DataTable.InsertOnly = true; ListFields.TraceUrl(); } diff --git a/AntJob/Models/LoginModel.cs b/AntJob/Models/LoginModel.cs index fbd8612..c9c2bbe 100644 --- a/AntJob/Models/LoginModel.cs +++ b/AntJob/Models/LoginModel.cs @@ -23,8 +23,8 @@ public class LoginModel : LoginRequest ///// 版本 //public String Version { get; set; } - /// 编译时间 - public DateTime Compile { get; set; } + ///// 编译时间 + //public DateTime Compile { get; set; } } ///// 登录响应 diff --git a/AntJob/Providers/AntClient.cs b/AntJob/Providers/AntClient.cs index cdc9ab8..163971f 100644 --- a/AntJob/Providers/AntClient.cs +++ b/AntJob/Providers/AntClient.cs @@ -83,7 +83,7 @@ public override ILoginRequest BuildLoginRequest() request.DisplayName = dname; request.Machine = Environment.MachineName; request.ProcessId = Process.GetCurrentProcess().Id; - request.Compile = asmx.Compile; + //request.Compile = asmx.Compile; return request; }