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#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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>();
}
/// <summary>
/// 记录请求和响应数据
/// </summary>
public static IApplicationBuilder UseRequRespLogMiddleware(this IApplicationBuilder app)
{
return app.UseMiddleware<RequRespLogMiddleware>();
}
/// <summary>
/// 公共数据缓存中间件
/// </summary>
public static IApplicationBuilder UseCommonCacheMiddleware(this IApplicationBuilder app)
{
return app.UseMiddleware<CommonDataCacheMiddleware>();
}
}
}