You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.5 KiB
C#

11 months ago
using djy_AfrApi.Milldlewares;
using Microsoft.AspNetCore.Builder;
namespace djy_AfrApi.Middlewares
{
public static class MiddlewareHelpers
{
/// <summary>
/// 异常处理
/// </summary>
public static IApplicationBuilder UseExceptionHandlerMiddle(this IApplicationBuilder app)
{
return app.UseMiddleware<ExceptionHandlerMiddleware>();
}
/// <summary>
/// 处理特殊情况下的响应格式401、403
/// </summary>
public static IApplicationBuilder UseUnifyResultMiddleware(this IApplicationBuilder app)
{
return app.UseMiddleware<UnifyResultMiddleware>();
}
/// <summary>
/// 二次验证授权并保存当前登录人User对象为了和ISF、AMS逻辑保持一致
/// </summary>
public static IApplicationBuilder UseNextAuthorizationMiddle(this IApplicationBuilder app)
{
return app.UseMiddleware<NextAuthorizationMiddleware>();
}
11 months ago
/// <summary>
/// 记录请求和响应数据
/// </summary>
11 months ago
public static IApplicationBuilder UseRequRespLogMiddleware(this IApplicationBuilder app)
{
return app.UseMiddleware<RequRespLogMiddleware>();
}
11 months ago
/// <summary>
/// 公共数据缓存中间件
/// </summary>
public static IApplicationBuilder UseCommonCacheMiddleware(this IApplicationBuilder app)
{
11 months ago
return app.UseMiddleware<CommonDataCacheMiddleware>();
11 months ago
}
11 months ago
}
}