FineAdmin.Service/Security/LogonLogService.cs
(完整代码) 1KBusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FineAdmin.Common;
using FineAdmin.IService;
using FineAdmin.Model;
namespace FineAdmin.Service
{
public class LogonLogService : BaseService<LogonLogModel>, ILogonLogService
{
public dynamic GetListByFilter(LogonLogModel filter, PageInfo pageInfo)
{
string _where = " where 1=1";
if (!string.IsNullOrEmpty(filter.Account))
{
_where += " and Account=@Account";
}
if (!string.IsNullOrEmpty(filter.RealName))
{
_where += " and RealName=@RealName";
}
_where = CreateTimeWhereStr(filter.StartEndDate, _where);
return GetListByFilter(filter, pageInfo, _where);
}
/// <summary>
/// 写入登录日志
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public int WriteDbLog(LogonLogModel model)
{
model.IPAddress = Net.Ip;
model.IPAddressName = Net.GetLocation(model.IPAddress);
model.CreateTime = DateTime.Now;
return BaseRepository.Insert(model);
}
}
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
