heyuntao
2023-10-23 45e3e2f4b3a55c3949c8a5bc5e6928f0cc2cacb1
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
29
30
31
32
33
34
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Operater.Common.Filter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
 
namespace Api.Operater.Filters
{
    public class ActionFilter : IActionFilter
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        public void OnActionExecuted(ActionExecutedContext context)
        {
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        public void OnActionExecuting(ActionExecutingContext context)
        {
            var filterRsp = ActionFilterHelper.FilterAct(context);
            if (!filterRsp.success)
            {
                context.Result = new OkObjectResult(filterRsp);
                return;
            }
        }
    }
}