Skip to content

Commit

Permalink
[fix]修正登录时上传编译时间的格式问题,采用LoginRequest的UTC数字时间,避免Json序列化问题
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Jul 26, 2024
1 parent 27bef35 commit 2a1d99d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions AntJob.Server/Services/AppService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion AntJob.Web/Areas/Ant/Controllers/AppOnlineController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class AppOnlineController : AntEntityController<AppOnline>
{
static AppOnlineController()
{
AppOnline.Meta.Table.DataTable.InsertOnly = true;
//AppOnline.Meta.Table.DataTable.InsertOnly = true;

ListFields.TraceUrl();
}
Expand Down
4 changes: 2 additions & 2 deletions AntJob/Models/LoginModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class LoginModel : LoginRequest
///// <summary>版本</summary>
//public String Version { get; set; }

/// <summary>编译时间</summary>
public DateTime Compile { get; set; }
///// <summary>编译时间</summary>
//public DateTime Compile { get; set; }
}

///// <summary>登录响应</summary>
Expand Down
2 changes: 1 addition & 1 deletion AntJob/Providers/AntClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2a1d99d

Please sign in to comment.