| 1234567891011121314151617181920212223242526272829 |
- using Abp.Web.Security.AntiForgery;
- using Microsoft.AspNetCore.Antiforgery;
- using VberAdmin.Controllers;
- namespace VberAdmin.Web.Host.Controllers;
- public class AntiForgeryController : VberAdminControllerBase
- {
- private readonly IAntiforgery _antiforgery;
- private readonly IAbpAntiForgeryManager _antiForgeryManager;
- public AntiForgeryController(IAntiforgery antiforgery, IAbpAntiForgeryManager antiForgeryManager)
- {
- _antiforgery = antiforgery;
- _antiForgeryManager = antiForgeryManager;
- }
- public void GetToken()
- {
- _antiforgery.SetCookieTokenAndHeader(HttpContext);
- }
- public void SetCookie()
- {
- _antiForgeryManager.SetCookie(HttpContext);
- }
- }
|