feat(Online): 移除 TaskLogHub 记录到访问日志中
This commit is contained in:
parent
2f7265667a
commit
789685a2ba
|
@ -111,7 +111,7 @@ namespace Bootstrap.Admin
|
|||
app.UseStaticFiles();
|
||||
app.UseBootstrapAdminAuthentication(RoleHelper.RetrievesByUserName, RoleHelper.RetrievesByUrl, AppHelper.RetrievesByUserName);
|
||||
app.UseBootstrapHealthChecks();
|
||||
app.UseOnlineUsers(callback: TraceHelper.Save);
|
||||
app.UseOnlineUsers(TraceHelper.Filter, TraceHelper.Save);
|
||||
app.UseCacheManager();
|
||||
app.UseSignalR(routes =>
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Http;
|
|||
using PetaPoco;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Bootstrap.DataAccess
|
||||
{
|
||||
|
@ -38,6 +39,17 @@ namespace Bootstrap.DataAccess
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 进入在线跟踪的地址过滤方法
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Filter(HttpContext context)
|
||||
{
|
||||
var url = context.Request.Path;
|
||||
return !new string[] { "/api", "/NotiHub", "/TaskLogHub", "/swagger" }.Any(r => url.StartsWithSegments(r, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获得指定IP历史访问记录
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue