您好,可以在.net Core文章的全局配置文件中配置相应的拦截器中间件,将其放在拦截器的前面混后面,.net core会将传进来的网络请求根据中间件注册的先后顺序,执行它的相应逻辑。中间件在官方文档地址为:https://docs.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-6.0 ,在其中的表述为:
Middleware is software that's assembled into an app pipeline to handle requests and responses. Each component:
Chooses whether to pass the request to the next component in the pipeline.
Can perform work before and after the next component in the pipeline.
Request delegates are used to build the request pipeline. The request delegates handle each HTTP request.
关于参数不固定的情况,您可以在中间件中对输入参数做一定的筛选以实现参数的过滤和其他逻辑操作。
... 展开详请