Merge branch 'master' of http://118.178.224.202:3000/ewide/ewide_core
This commit is contained in:
@@ -115,10 +115,14 @@ namespace Ewide.Core.Service
|
||||
var httpContext = App.GetService<IHttpContextAccessor>().HttpContext;
|
||||
var loginOutput = user.Adapt<LoginOutput>();
|
||||
|
||||
loginOutput.LastLoginTime = user.LastLoginTime = DateTimeOffset.Now;
|
||||
loginOutput.LastLoginTime = user.LastLoginTime = DateTime.Now;
|
||||
var ip = httpContext.Request.Headers["X-Real-IP"].FirstOrDefault();
|
||||
loginOutput.LastLoginIp = user.LastLoginIp = string.IsNullOrEmpty(user.LastLoginIp) ? httpContext.GetRemoteIpAddressToIPv4() : ip;
|
||||
|
||||
///如果真实ip为空的话,就获取客户端主机IPv4地址
|
||||
if (string.IsNullOrEmpty(ip))
|
||||
{
|
||||
loginOutput.LastLoginIp = httpContext.GetRemoteIpAddressToIPv4();
|
||||
}
|
||||
//var ipInfo = IpTool.Search(loginOutput.LastLoginIp);
|
||||
//loginOutput.LastLoginAddress = ipInfo.Country + ipInfo.Province + ipInfo.City + "[" + ipInfo.NetworkOperator + "][" + ipInfo.Latitude + ipInfo.Longitude + "]";
|
||||
|
||||
@@ -174,14 +178,34 @@ namespace Ewide.Core.Service
|
||||
{
|
||||
_httpContextAccessor.SignoutToSwagger();
|
||||
//_httpContextAccessor.HttpContext.Response.Headers["access-token"] = "invalid token";
|
||||
var user = _userManager.User;
|
||||
var userId = user.Id;
|
||||
|
||||
var httpContext = App.GetService<IHttpContextAccessor>().HttpContext;
|
||||
var loginOutput = user.Adapt<LoginOutput>();
|
||||
|
||||
|
||||
var ip = httpContext.Request.Headers["X-Real-IP"];
|
||||
var LastLoginIp = user.LastLoginIp = string.IsNullOrEmpty(user.LastLoginIp) ? httpContext.GetRemoteIpAddressToIPv4() : ip;
|
||||
var clent = Parser.GetDefault().Parse(httpContext.Request.Headers["User-Agent"]);
|
||||
loginOutput.LastLoginBrowser = clent.UA.Family + clent.UA.Major;
|
||||
///如果真实ip为空的话,就获取客户端主机IPv4地址
|
||||
if (string.IsNullOrEmpty(ip))
|
||||
{
|
||||
LastLoginIp = httpContext.GetRemoteIpAddressToIPv4();
|
||||
}
|
||||
// 增加退出日志
|
||||
await new SysLogVis
|
||||
{
|
||||
Name = "退出",
|
||||
VisTime = DateTime.Now,
|
||||
Success = true,
|
||||
Message = "退出成功",
|
||||
VisType = 2
|
||||
VisType = 2,
|
||||
Browser = loginOutput.LastLoginBrowser,
|
||||
Os = loginOutput.LastLoginOs,
|
||||
Ip = LastLoginIp,
|
||||
Account = loginOutput.Account
|
||||
}.InsertAsync();
|
||||
|
||||
await Task.CompletedTask;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Ewide.Core.Service
|
||||
/// <summary>
|
||||
/// 生日
|
||||
/// </summary>
|
||||
public DateTimeOffset Birthday { get; set; }
|
||||
public DateTime? Birthday { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 性别(字典 1男 2女)
|
||||
@@ -73,7 +73,7 @@ namespace Ewide.Core.Service
|
||||
/// <summary>
|
||||
/// 最后登陆时间
|
||||
/// </summary>
|
||||
public DateTimeOffset LastLoginTime { get; set; }
|
||||
public DateTime LastLoginTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后登陆地址
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace Ewide.Core.Service
|
||||
/// <summary>
|
||||
/// 操作时间
|
||||
/// </summary>
|
||||
public DateTimeOffset OpTime { get; set; }
|
||||
public DateTime OpTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作人
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Ewide.Core.Service
|
||||
/// <summary>
|
||||
/// 访问时间
|
||||
/// </summary>
|
||||
public DateTimeOffset VisTime { get; set; }
|
||||
public DateTime VisTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访问人
|
||||
|
||||
@@ -45,12 +45,12 @@ namespace Ewide.Core.Service
|
||||
/// <summary>
|
||||
/// 发布时间
|
||||
/// </summary>
|
||||
public DateTimeOffset PublicTime { get; set; }
|
||||
public DateTime PublicTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 撤回时间
|
||||
/// </summary>
|
||||
public DateTimeOffset CancelTime { get; set; }
|
||||
public DateTime CancelTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态(字典 0草稿 1发布 2撤回 3删除)
|
||||
|
||||
@@ -39,6 +39,6 @@ namespace Ewide.Core.Service
|
||||
/// <summary>
|
||||
/// 阅读时间
|
||||
/// </summary>
|
||||
public DateTimeOffset ReadTime { get; set; }
|
||||
public DateTime ReadTime { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,6 @@ namespace Ewide.Core.Service
|
||||
/// <summary>
|
||||
/// 阅读时间
|
||||
/// </summary>
|
||||
public DateTimeOffset ReadTime { get; set; }
|
||||
public DateTime ReadTime { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Ewide.Core.Service.Notice
|
||||
await UpdatePublicInfo(notice);
|
||||
// 如果是发布,则设置发布时间
|
||||
if (input.Status == (int)NoticeStatus.PUBLIC)
|
||||
notice.PublicTime = DateTimeOffset.Now;
|
||||
notice.PublicTime = DateTime.Now;
|
||||
var newItem = await notice.InsertNowAsync();
|
||||
|
||||
// 通知到的人
|
||||
@@ -113,7 +113,7 @@ namespace Ewide.Core.Service.Notice
|
||||
var notice = input.Adapt<SysNotice>();
|
||||
if (input.Status == (int)NoticeStatus.PUBLIC)
|
||||
{
|
||||
notice.PublicTime = DateTimeOffset.Now;
|
||||
notice.PublicTime = DateTime.Now;
|
||||
await UpdatePublicInfo(notice);
|
||||
}
|
||||
await notice.UpdateAsync();
|
||||
@@ -179,11 +179,11 @@ namespace Ewide.Core.Service.Notice
|
||||
|
||||
if (input.Status == (int)NoticeStatus.CANCEL)
|
||||
{
|
||||
notice.CancelTime = DateTimeOffset.Now;
|
||||
notice.CancelTime = DateTime.Now;
|
||||
}
|
||||
else if (input.Status == (int)NoticeStatus.PUBLIC)
|
||||
{
|
||||
notice.PublicTime = DateTimeOffset.Now;
|
||||
notice.PublicTime = DateTime.Now;
|
||||
}
|
||||
await notice.UpdateAsync();
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace Ewide.Core.Service.Notice
|
||||
if (noticeUser != null)
|
||||
{
|
||||
noticeUser.ReadStatus = status;
|
||||
noticeUser.ReadTime = DateTimeOffset.Now;
|
||||
noticeUser.ReadTime = DateTime.Now;
|
||||
await noticeUser.UpdateAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,13 +24,13 @@ namespace Ewide.Core.Service
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
public DateTimeOffset BeginTime { get; set; } = DateTimeOffset.Now;
|
||||
public DateTime BeginTime { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
/// <example>null</example>
|
||||
public DateTimeOffset? EndTime { get; set; }
|
||||
public DateTime? EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Cron表达式
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Ewide.Core.Service
|
||||
/// <summary>
|
||||
/// 生日
|
||||
/// </summary>
|
||||
public virtual DateTimeOffset Birthday { get; set; }
|
||||
public virtual DateTime? Birthday { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 性别-男_1、女_2
|
||||
|
||||
@@ -158,6 +158,7 @@ namespace Ewide.Core.Service
|
||||
|
||||
var user = input.Adapt<SysUser>();
|
||||
await user.UpdateExcludeAsync(new[] { nameof(SysUser.Password), nameof(SysUser.Status), nameof(SysUser.AdminType) }, true);
|
||||
user.UpdateIncludeNow(new[] { nameof(SysUser.Birthday) });
|
||||
input.SysEmpParam.Id = user.Id.ToString();
|
||||
// 更新员工及附属机构职位信息
|
||||
await _sysEmpService.AddOrUpdate(input.SysEmpParam);
|
||||
|
||||
Reference in New Issue
Block a user