feat(#IW46T): 访问日志移除UserAgent数据

comment #IW46T

close https://gitee.com/LongbowEnterprise/dashboard/issues?id=IW46T
This commit is contained in:
Argo Zhang 2019-05-01 18:05:14 +08:00
parent d3eb38d854
commit 069ab54b21
1 changed files with 4 additions and 2 deletions

View File

@ -69,11 +69,13 @@ namespace Bootstrap.DataAccess
/// <summary>
///
/// </summary>
/// <param name="ip"></param>
/// <param name="po"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <returns></returns>
public virtual Page<Trace> Retrieves(PaginationOption po, DateTime? startTime, DateTime? endTime)
{
var sql = new Sql("select * from Traces");
var sql = new Sql("select UserName, LogTime, IP, Browser, OS, City, RequestUrl from Traces");
if (startTime.HasValue) sql.Append("where LogTime > @0", startTime.Value);
if (endTime.HasValue) sql.Append("where LogTime < @0", endTime.Value.AddDays(1).AddSeconds(-1));
if (startTime == null && endTime == null) sql.Append("where LogTime > @0", DateTime.Today.AddMonths(0 - DictHelper.RetrieveAccessLogPeriod()));