diff --git a/samples/MicroserviceDemo/applications/AuthServer.Host/Pages/Index.cshtml.cs b/samples/MicroserviceDemo/applications/AuthServer.Host/Pages/Index.cshtml.cs index 0894e658dc..61b644778a 100644 --- a/samples/MicroserviceDemo/applications/AuthServer.Host/Pages/Index.cshtml.cs +++ b/samples/MicroserviceDemo/applications/AuthServer.Host/Pages/Index.cshtml.cs @@ -1,8 +1,8 @@ -using Microsoft.AspNetCore.Mvc.RazorPages; +using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; namespace AuthServer.Host.Pages { - public class IndexModel : PageModel + public class IndexModel : AbpPageModel { public void OnGet() { diff --git a/samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/Index.cshtml b/samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/Index.cshtml index b01d764c94..4f80454947 100644 --- a/samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/Index.cshtml +++ b/samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/Index.cshtml @@ -1,4 +1,17 @@ @page +@using Volo.Abp.Users @model PublicWebSite.Host.Pages.IndexModel +@inject ICurrentUser CurrentUser

Public Web Site Application

-

Welcome...

\ No newline at end of file +

Welcome...

+ +@if (CurrentUser.IsAuthenticated) +{ + Logout +} +else +{ +
+ +
+} \ No newline at end of file diff --git a/samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/Index.cshtml.cs b/samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/Index.cshtml.cs index 996b92171e..3e966beca2 100644 --- a/samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/Index.cshtml.cs +++ b/samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/Index.cshtml.cs @@ -1,16 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.Authentication; +using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; namespace PublicWebSite.Host.Pages { - public class IndexModel : PageModel + public class IndexModel : AbpPageModel { public void OnGet() { + + } + + public async Task OnPostLoginAsync() + { + await HttpContext.ChallengeAsync("oidc"); } } } \ No newline at end of file diff --git a/samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/Products.cshtml.cs b/samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/Products.cshtml.cs index 7741bbdf07..d82aa68175 100644 --- a/samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/Products.cshtml.cs +++ b/samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/Products.cshtml.cs @@ -1,12 +1,12 @@ using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.RazorPages; using MyCompanyName.ProductManagement; using ProductManagement; using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; namespace PublicWebSite.Host.Pages { - public class ProductsModel : PageModel + public class ProductsModel : AbpPageModel { public ListResultDto Products { get; set; } diff --git a/samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/_ViewImports.cshtml b/samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/_ViewImports.cshtml new file mode 100644 index 0000000000..c1da1f5f10 --- /dev/null +++ b/samples/MicroserviceDemo/applications/PublicWebSite.Host/Pages/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling \ No newline at end of file diff --git a/samples/MicroserviceDemo/applications/PublicWebSite.Host/wwwroot/files/ec882345a403be325bc539ebda211e79.jpg b/samples/MicroserviceDemo/applications/PublicWebSite.Host/wwwroot/files/ec882345a403be325bc539ebda211e79.jpg new file mode 100644 index 0000000000..be89ceb73d Binary files /dev/null and b/samples/MicroserviceDemo/applications/PublicWebSite.Host/wwwroot/files/ec882345a403be325bc539ebda211e79.jpg differ