-
-
+
\ No newline at end of file
diff --git a/Bootstrap.Admin/wwwroot/js/logins.js b/Bootstrap.Admin/wwwroot/js/logins.js
index de563242..db578bc6 100644
--- a/Bootstrap.Admin/wwwroot/js/logins.js
+++ b/Bootstrap.Admin/wwwroot/js/logins.js
@@ -6,6 +6,7 @@ $(function () {
showToggle: false,
showRefresh: false,
showColumns: false,
+ queryParams: function (params) { return $.extend(params, { loginIp: $('#txt_ip').val() }); },
columns: [
{
title: "序号", formatter: function (value, row, index) {
@@ -28,8 +29,4 @@ $(function () {
}
]
});
-
- $('#refreshUsers').tooltip().on('click', function () {
- $table.bootstrapTable('refresh');
- });
});
\ No newline at end of file
diff --git a/Bootstrap.DataAccess.MongoDB/LoginUser.cs b/Bootstrap.DataAccess.MongoDB/LoginUser.cs
index 661d9f57..2cb54140 100644
--- a/Bootstrap.DataAccess.MongoDB/LoginUser.cs
+++ b/Bootstrap.DataAccess.MongoDB/LoginUser.cs
@@ -2,7 +2,6 @@
using MongoDB.Driver;
using PetaPoco;
using System;
-using System.Collections.Generic;
using System.Linq;
namespace Bootstrap.DataAccess.MongoDB
@@ -28,10 +27,10 @@ namespace Bootstrap.DataAccess.MongoDB
///
///
///
- public override Page
Retrieves(PaginationOption po)
+ public override Page Retrieves(PaginationOption po, string ip)
{
var logs = DbManager.LoginUsers
- .Find(Builders.Filter.Empty)
+ .Find(Builders.Filter.Eq("Ip", ip))
.Sort(Builders.Sort.Descending(t => t.LoginTime))
.ToList();
diff --git a/Bootstrap.DataAccess/Helper/LoginHelper.cs b/Bootstrap.DataAccess/Helper/LoginHelper.cs
index 477a76b8..1a24a483 100644
--- a/Bootstrap.DataAccess/Helper/LoginHelper.cs
+++ b/Bootstrap.DataAccess/Helper/LoginHelper.cs
@@ -20,6 +20,7 @@ namespace Bootstrap.DataAccess
/// 查询所有登录日志
///
///
- public static Page Retrieves(PaginationOption po) => DbContextManager.Create().Retrieves(po);
+ ///
+ public static Page Retrieves(PaginationOption po, string ip) => DbContextManager.Create().Retrieves(po, ip);
}
}
diff --git a/Bootstrap.DataAccess/LoginUser.cs b/Bootstrap.DataAccess/LoginUser.cs
index b9e83e88..3b2847a0 100644
--- a/Bootstrap.DataAccess/LoginUser.cs
+++ b/Bootstrap.DataAccess/LoginUser.cs
@@ -71,7 +71,14 @@ namespace Bootstrap.DataAccess
///
///
///
+ ///
///
- public virtual Page Retrieves(PaginationOption po) => DbManager.Create().Page(po.PageIndex, po.Limit, "select UserName, LoginTime, Ip, Browser, OS, City, Result from LoginLogs Order by LoginTime desc");
+ public virtual Page Retrieves(PaginationOption po, string ip)
+ {
+ var sql = new Sql("select UserName, LoginTime, Ip, Browser, OS, City, Result from LoginLogs");
+ if (!string.IsNullOrEmpty(ip)) sql.Where("ip = @0", ip);
+ sql.OrderBy("LoginTime desc");
+ return DbManager.Create().Page(po.PageIndex, po.Limit, sql);
+ }
}
}