lixiaojun
2024-09-09 c0f3c3f170846197d8d3f74ac123e0ac93a6dd67
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace IStation.WebApi
{
    /// <summary>
    /// 
    /// </summary>
    public class AuthorizationFilter : IAsyncAuthorizationFilter
    {
 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public async Task OnAuthorizationAsync(AuthorizationFilterContext context)
        {
            //执行顺序 3 线程6
            await Task.Run(() => LogHelper.Info($"AuthorizationFilter:{context.HttpContext.Request.Path}"));
 
        }
    }
}