mirror of https://github.com/abpframework/abp
				
				
				
			Merge branch 'dev' of https://github.com/volosoft/abp into dev
	
		
	
				
					
				
			
						commit
						0104648dab
					
				@ -0,0 +1,32 @@
 | 
				
			||||
<Project Sdk="Microsoft.NET.Sdk.Web">
 | 
				
			||||
 | 
				
			||||
  <Import Project="..\..\common.props" />
 | 
				
			||||
  
 | 
				
			||||
  <PropertyGroup>
 | 
				
			||||
    <TargetFramework>netstandard2.1</TargetFramework>
 | 
				
			||||
    <RazorLangVersion>3.0</RazorLangVersion>
 | 
				
			||||
  </PropertyGroup>
 | 
				
			||||
 | 
				
			||||
  <ItemGroup>
 | 
				
			||||
    <PackageReference Include="Blazorise.Bootstrap" Version="0.9.1.2" />
 | 
				
			||||
    <PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.1.2" />
 | 
				
			||||
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.1" PrivateAssets="all" />
 | 
				
			||||
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.1" PrivateAssets="all" />
 | 
				
			||||
  </ItemGroup>
 | 
				
			||||
 | 
				
			||||
  <ItemGroup>
 | 
				
			||||
    <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac.WebAssembly\Volo.Abp.Autofac.WebAssembly.csproj" />
 | 
				
			||||
    <ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme\Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.csproj" />
 | 
				
			||||
  </ItemGroup>
 | 
				
			||||
 | 
				
			||||
  <ItemGroup>
 | 
				
			||||
    <ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Blazor\Volo.Abp.Identity.Blazor.csproj" />
 | 
				
			||||
    <ProjectReference Include="..\..\..\..\..\modules\account\src\Volo.Abp.Account.Blazor\Volo.Abp.Account.Blazor.csproj" />
 | 
				
			||||
  </ItemGroup>
 | 
				
			||||
 | 
				
			||||
  <ItemGroup>
 | 
				
			||||
    <ProjectReference Include="..\MyCompanyName.MyProjectName.Host.Shared\MyCompanyName.MyProjectName.Host.Shared.csproj" />
 | 
				
			||||
    <ProjectReference Include="..\..\src\MyCompanyName.MyProjectName.Blazor\MyCompanyName.MyProjectName.Blazor.csproj" />
 | 
				
			||||
  </ItemGroup>
 | 
				
			||||
 | 
				
			||||
</Project>
 | 
				
			||||
@ -0,0 +1,60 @@
 | 
				
			||||
@page "/"
 | 
				
			||||
@using Volo.Abp.Users
 | 
				
			||||
@using Volo.Abp.MultiTenancy
 | 
				
			||||
@using System.Security.Claims
 | 
				
			||||
@inject ICurrentUser CurrentUser
 | 
				
			||||
@inject ICurrentTenant CurrentTenant
 | 
				
			||||
@inject AuthenticationStateProvider AuthenticationStateProvider
 | 
				
			||||
 | 
				
			||||
<h1>Welcome to MyProjectName!</h1>
 | 
				
			||||
 | 
				
			||||
@if (CurrentUser.IsAuthenticated)
 | 
				
			||||
{
 | 
				
			||||
    <h3>Current User</h3>
 | 
				
			||||
    <ul>
 | 
				
			||||
        <li>Id: <strong>@CurrentUser.Id</strong></li>
 | 
				
			||||
        <li>TenantId: <strong>@CurrentUser.TenantId</strong></li>
 | 
				
			||||
        <li>UserName: <strong>@CurrentUser.UserName</strong></li>
 | 
				
			||||
        <li>Name: <strong>@CurrentUser.Name</strong></li>
 | 
				
			||||
        <li>SurName: <strong>@CurrentUser.SurName</strong></li>
 | 
				
			||||
        <li>Email: <strong>@CurrentUser.Email</strong></li>
 | 
				
			||||
        <li>EmailVerified: <strong>@CurrentUser.EmailVerified</strong></li>
 | 
				
			||||
        <li>PhoneNumber: <strong>@CurrentUser.PhoneNumber</strong></li>
 | 
				
			||||
        <li>PhoneNumberVerified: <strong>@CurrentUser.PhoneNumberVerified</strong></li>
 | 
				
			||||
        <li>Roles: <strong>@CurrentUser.Roles.JoinAsString(", ")</strong></li>
 | 
				
			||||
    </ul>
 | 
				
			||||
}
 | 
				
			||||
 | 
				
			||||
@if (_claims != null)
 | 
				
			||||
{
 | 
				
			||||
    <h3>Current Claims</h3>
 | 
				
			||||
    <ul>
 | 
				
			||||
        @foreach (var claim in _claims)
 | 
				
			||||
        {
 | 
				
			||||
            <li>@claim.Type: @claim.Value</li>
 | 
				
			||||
        }
 | 
				
			||||
    </ul>
 | 
				
			||||
}
 | 
				
			||||
 | 
				
			||||
@if (CurrentTenant.IsAvailable)
 | 
				
			||||
{
 | 
				
			||||
    <h3>Current Tenant</h3>
 | 
				
			||||
    <ul>
 | 
				
			||||
        <li>Id: <strong>@CurrentTenant.Id</strong></li>
 | 
				
			||||
        <li>Name: <strong>@CurrentTenant.Name</strong></li>
 | 
				
			||||
    </ul>
 | 
				
			||||
}
 | 
				
			||||
 | 
				
			||||
@code
 | 
				
			||||
{
 | 
				
			||||
    private IEnumerable<Claim> _claims;
 | 
				
			||||
 | 
				
			||||
    protected override async Task OnInitializedAsync()
 | 
				
			||||
    {
 | 
				
			||||
        var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
 | 
				
			||||
        if (authState.User.Identity.IsAuthenticated)
 | 
				
			||||
        {
 | 
				
			||||
            _claims = authState.User.Claims;
 | 
				
			||||
        }
 | 
				
			||||
    }
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,24 @@
 | 
				
			||||
using System.Threading.Tasks;
 | 
				
			||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
 | 
				
			||||
 | 
				
			||||
namespace MyCompanyName.MyProjectName.Blazor.Host
 | 
				
			||||
{
 | 
				
			||||
    public class Program
 | 
				
			||||
    {
 | 
				
			||||
        public static async Task Main(string[] args)
 | 
				
			||||
        {
 | 
				
			||||
            var builder = WebAssemblyHostBuilder.CreateDefault(args);
 | 
				
			||||
 | 
				
			||||
            var application = builder.AddApplication<MyProjectNameBlazorHostModule>(options =>
 | 
				
			||||
            {
 | 
				
			||||
                options.UseAutofac();
 | 
				
			||||
            });
 | 
				
			||||
 | 
				
			||||
            var host = builder.Build();
 | 
				
			||||
 | 
				
			||||
            await application.InitializeAsync(host.Services);
 | 
				
			||||
 | 
				
			||||
            await host.RunAsync();
 | 
				
			||||
        }
 | 
				
			||||
    }
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,29 @@
 | 
				
			||||
{
 | 
				
			||||
  "iisSettings": {
 | 
				
			||||
    "windowsAuthentication": false,
 | 
				
			||||
    "anonymousAuthentication": true,
 | 
				
			||||
    "iisExpress": {
 | 
				
			||||
      "applicationUrl": "https://localhost:44307",
 | 
				
			||||
      "sslPort": 44307
 | 
				
			||||
    }
 | 
				
			||||
  },
 | 
				
			||||
  "profiles": {
 | 
				
			||||
    "IIS Express": {
 | 
				
			||||
      "commandName": "IISExpress",
 | 
				
			||||
      "launchBrowser": true,
 | 
				
			||||
      "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
 | 
				
			||||
      "environmentVariables": {
 | 
				
			||||
        "ASPNETCORE_ENVIRONMENT": "Development"
 | 
				
			||||
      }
 | 
				
			||||
    },
 | 
				
			||||
    "MyCompanyName.MyProjectName.Blazor": {
 | 
				
			||||
      "commandName": "Project",
 | 
				
			||||
      "launchBrowser": true,
 | 
				
			||||
      "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
 | 
				
			||||
      "applicationUrl": "https://localhost:44307",
 | 
				
			||||
      "environmentVariables": {
 | 
				
			||||
        "ASPNETCORE_ENVIRONMENT": "Development"
 | 
				
			||||
      }
 | 
				
			||||
    }
 | 
				
			||||
  }
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,11 @@
 | 
				
			||||
@using System.Net.Http
 | 
				
			||||
@using Microsoft.AspNetCore.Components.Authorization
 | 
				
			||||
@using Microsoft.AspNetCore.Components.Forms
 | 
				
			||||
@using Microsoft.AspNetCore.Components.Routing
 | 
				
			||||
@using Microsoft.AspNetCore.Components.Web
 | 
				
			||||
@using Microsoft.AspNetCore.Components.WebAssembly.Http
 | 
				
			||||
@using Microsoft.JSInterop
 | 
				
			||||
@using Volo.Abp.AspNetCore.Components.WebAssembly
 | 
				
			||||
@using MyCompanyName.MyProjectName.Blazor
 | 
				
			||||
@using Blazorise
 | 
				
			||||
@using Blazorise.DataGrid
 | 
				
			||||
@ -0,0 +1,3 @@
 | 
				
			||||
{
 | 
				
			||||
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,12 @@
 | 
				
			||||
{
 | 
				
			||||
  "AuthServer": {
 | 
				
			||||
    "Authority": "https://localhost:44301",
 | 
				
			||||
    "ClientId": "MyProjectName_Blazor",
 | 
				
			||||
    "ResponseType": "code"
 | 
				
			||||
  },
 | 
				
			||||
  "RemoteServices": {
 | 
				
			||||
    "Default": {
 | 
				
			||||
      "BaseUrl": "https://localhost:44300"
 | 
				
			||||
    } 
 | 
				
			||||
  } 
 | 
				
			||||
}
 | 
				
			||||
| 
		 After Width: | Height: | Size: 31 KiB  | 
@ -0,0 +1,27 @@
 | 
				
			||||
{
 | 
				
			||||
  "iisSettings": {
 | 
				
			||||
    "windowsAuthentication": false,
 | 
				
			||||
    "anonymousAuthentication": true,
 | 
				
			||||
    "iisExpress": {
 | 
				
			||||
      "applicationUrl": "http://localhost:64779/",
 | 
				
			||||
      "sslPort": 44326
 | 
				
			||||
    }
 | 
				
			||||
  },
 | 
				
			||||
  "profiles": {
 | 
				
			||||
    "IIS Express": {
 | 
				
			||||
      "commandName": "IISExpress",
 | 
				
			||||
      "launchBrowser": true,
 | 
				
			||||
      "environmentVariables": {
 | 
				
			||||
        "ASPNETCORE_ENVIRONMENT": "Development"
 | 
				
			||||
      }
 | 
				
			||||
    },
 | 
				
			||||
    "MyCompanyName.MyProjectName.Web": {
 | 
				
			||||
      "commandName": "Project",
 | 
				
			||||
      "launchBrowser": true,
 | 
				
			||||
      "environmentVariables": {
 | 
				
			||||
        "ASPNETCORE_ENVIRONMENT": "Development"
 | 
				
			||||
      },
 | 
				
			||||
      "applicationUrl": "https://localhost:5001;http://localhost:5000"
 | 
				
			||||
    }
 | 
				
			||||
  }
 | 
				
			||||
}
 | 
				
			||||
					Loading…
					
					
				
		Reference in new issue