【发布时间】:2019-05-08 03:06:24
【问题描述】:
我正在使用 Startup.cs 中配置的全局 AutoValidateAntiforgeryTokenAttribute,但我需要为两个操作禁用它,有没有办法覆盖它,或者这样做时是全部还是没有?当整个应用程序中只有两个不需要它的Action时,我宁愿不将Attribute添加到每个Action中......
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddMvc(options => {
options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute());
});
}
【问题讨论】:
标签: asp.net-mvc asp.net-core antiforgerytoken