Index.cshtml 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. @page
  2. @using Volo.Abp.Users
  3. @model AuthServer.Host.Pages.IndexModel
  4. @inject ICurrentUser CurrentUser
  5. @if (CurrentUser.IsAuthenticated)
  6. {
  7. <div>
  8. <abp-row>
  9. <abp-column size-md="_3" class="text-center">
  10. <i class="fa fa-user d-block" style="font-size: 10em; color: #12b900"></i>
  11. <a abp-button="Primary" asp-controller="Logout" asp-action="Index" asp-area="Account">Logout</a>
  12. </abp-column>
  13. <abp-column size-md="_9">
  14. <h2>@CurrentUser.UserName</h2>
  15. <h5 class="text-muted">@CurrentUser.Email</h5>
  16. <div>
  17. <strong>Roles</strong>: @CurrentUser.Roles.JoinAsString(", ")
  18. <br />
  19. <strong>Claims</strong>: <br />
  20. @Html.Raw(CurrentUser.GetAllClaims().Select(c => $"{c.Type}={c.Value}").JoinAsString(" <br /> "))
  21. </div>
  22. </abp-column>
  23. </abp-row>
  24. </div>
  25. }
  26. @if (!CurrentUser.IsAuthenticated)
  27. {
  28. <div class="text-center">
  29. <img src="~/images/anonymous-user.png" width="200" /><br/><br />
  30. <a abp-button="Primary" asp-page="/Account/Login">Login</a>
  31. </div>
  32. }