Logout.cshtml.cs 534 B

12345678910111213141516171819202122
  1. using JCSoft.WX.Framework.Api;
  2. using Microsoft.Extensions.Caching.Memory;
  3. using Microsoft.AspNetCore.Authentication;
  4. namespace SupplierWeb.Pages
  5. {
  6. public class LogoutModel : LoginedPageModel
  7. {
  8. public LogoutModel(IMemoryCache cache, IApiClient client) : base(cache, client)
  9. {
  10. }
  11. public override int Index => -1;
  12. public override int SubIndex => -1;
  13. public void OnGet()
  14. {
  15. HttpContext?.SignOutAsync();
  16. Response.Redirect("/login");
  17. }
  18. }
  19. }