Browse Source

分离IdentityServer Api,使IdentityServer服务器单一职能

pull/1/head
cKey 6 years ago
parent
commit
6a91fd1a11
  1. 62
      aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs
  2. 23
      aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj
  3. 34
      aspnet-core/services/account/AuthServer.Host/Pages/Index.cshtml
  4. 11
      aspnet-core/services/account/AuthServer.Host/Pages/Index.cshtml.cs
  5. 4
      aspnet-core/services/account/AuthServer.Host/Pages/_ViewImports.cshtml
  6. 15
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj
  7. 19
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs
  8. 1
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/tempkey.rsa
  9. 2
      vueJs/src/api/roles.ts
  10. 2
      vueJs/src/api/users.ts
  11. 4
      vueJs/src/lang/zh.ts
  12. 313
      vueJs/src/router/index.ts
  13. 57
      vueJs/src/router/modules/admin.ts
  14. 57
      vueJs/src/router/modules/apigateway.ts
  15. 47
      vueJs/src/router/modules/identityServer.ts
  16. 27
      vueJs/src/router/modules/task.ts
  17. 20
      vueJs/src/views/admin/apigateway/route.vue
  18. 4
      vueJs/src/views/admin/identityServer/identity-resources/components/IdentityResourceCreateOrEditForm.vue

62
aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs

@ -1,6 +1,5 @@
using DotNetCore.CAP; using DotNetCore.CAP;
using LINGYUN.Abp.EventBus.CAP; using LINGYUN.Abp.EventBus.CAP;
using LINGYUN.Abp.IdentityServer;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.DataProtection;
@ -8,23 +7,17 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Microsoft.OpenApi.Models;
using StackExchange.Redis; using StackExchange.Redis;
using System; using System;
using System.Linq; using System.Linq;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Account; using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Authentication.JwtBearer;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.Auditing; using Volo.Abp.Auditing;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
using Volo.Abp.Data; using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.MySQL; using Volo.Abp.EntityFrameworkCore.MySQL;
using Volo.Abp.Identity; using Volo.Abp.Identity.AspNetCore;
using Volo.Abp.Identity.EntityFrameworkCore; using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.IdentityServer.EntityFrameworkCore; using Volo.Abp.IdentityServer.EntityFrameworkCore;
using Volo.Abp.Localization; using Volo.Abp.Localization;
@ -34,28 +27,19 @@ using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore; using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.TenantManagement.EntityFrameworkCore; using Volo.Abp.TenantManagement.EntityFrameworkCore;
using Volo.Abp.Threading; using Volo.Abp.Threading;
using Volo.Abp.UI.Navigation.Urls;
namespace AuthServer.Host namespace AuthServer.Host
{ {
[DependsOn( [DependsOn(
typeof(AbpIdentityServerApplicationModule), typeof(AbpAspNetCoreMultiTenancyModule),
typeof(AbpIdentityServerHttpApiModule),
typeof(AbpAccountApplicationModule),
typeof(AbpAccountWebIdentityServerModule),
typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
typeof(AbpAspNetCoreMvcModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAutofacModule), typeof(AbpAutofacModule),
typeof(AbpCAPEventBusModule), typeof(AbpCAPEventBusModule),
typeof(AbpIdentityAspNetCoreModule),
typeof(AbpEntityFrameworkCoreMySQLModule), typeof(AbpEntityFrameworkCoreMySQLModule),
typeof(AbpIdentityHttpApiModule),
typeof(AbpIdentityApplicationModule),
typeof(AbpIdentityEntityFrameworkCoreModule), typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpIdentityServerEntityFrameworkCoreModule), typeof(AbpIdentityServerEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpTenantManagementEntityFrameworkCoreModule), typeof(AbpTenantManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule)
typeof(AbpAspNetCoreAuthenticationJwtBearerModule)
)] )]
public class AuthIdentityServerModule : AbpModule public class AuthIdentityServerModule : AbpModule
{ {
@ -86,14 +70,6 @@ namespace AuthServer.Host
options.UseMySQL(); options.UseMySQL();
}); });
context.Services.AddSwaggerGen(
options =>
{
options.SwaggerDoc("v1", new OpenApiInfo { Title = "AuthServer API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName);
});
Configure<AbpLocalizationOptions>(options => Configure<AbpLocalizationOptions>(options =>
{ {
options.Languages.Add(new LanguageInfo("en", "en", "English")); options.Languages.Add(new LanguageInfo("en", "en", "English"));
@ -106,18 +82,14 @@ namespace AuthServer.Host
options.ApplicationName = "AuthServer"; options.ApplicationName = "AuthServer";
}); });
Configure<AppUrlOptions>(options => // context.Services.AddAuthentication();
{ //context.Services.AddAuthentication()
options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; // .AddIdentityServerAuthentication(options =>
}); // {
// options.Authority = configuration["AuthServer:Authority"];
context.Services.AddAuthentication() // options.RequireHttpsMetadata = false;
.AddIdentityServerAuthentication(options => // options.ApiName = configuration["AuthServer:ApiName"];
{ // });
options.Authority = configuration["AuthServer:Authority"];
options.RequireHttpsMetadata = false;
options.ApiName = configuration["AuthServer:ApiName"];
});
Configure<AbpMultiTenancyOptions>(options => Configure<AbpMultiTenancyOptions>(options =>
{ {
@ -167,17 +139,9 @@ namespace AuthServer.Host
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
app.UseRouting(); app.UseRouting();
app.UseCors(DefaultCorsPolicyName); app.UseCors(DefaultCorsPolicyName);
app.UseAuthentication();
app.UseJwtTokenMiddleware();
app.UseMultiTenancy(); app.UseMultiTenancy();
app.UseIdentityServer(); app.UseIdentityServer();
app.UseSwagger();
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support AuthServer API");
});
app.UseAuditing(); app.UseAuditing();
app.UseMvcWithDefaultRouteAndArea();
SeedData(context); SeedData(context);
} }

23
aspnet-core/services/account/AuthServer.Host/AuthServer.Host.csproj

@ -14,25 +14,17 @@
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" /> <PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" /> <PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.4.1" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.1.3" /> <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.1.3" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.3" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.3"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.3">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="2.7.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="2.7.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="2.7.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" Version="2.7.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="2.7.0" /> <PackageReference Include="Volo.Abp.Autofac" Version="2.7.0" />
<PackageReference Include="Volo.Abp.Account.Application" Version="2.7.0" /> <PackageReference Include="Volo.Abp.Identity.AspNetCore" Version="2.7.0" />
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" Version="2.7.0" /> <PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" Version="2.7.0" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.MySql" Version="2.7.0" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.MySql" Version="2.7.0" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="2.7.0" /> <PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="2.7.0" />
<PackageReference Include="Volo.Abp.Identity.Application" Version="2.7.0" />
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="2.7.0" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="2.7.0" /> <PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="2.7.0" />
<PackageReference Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="2.7.0" /> <PackageReference Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="2.7.0" />
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="2.7.0" /> <PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="2.7.0" />
@ -42,17 +34,6 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" /> <ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Common.EventBus\LINGYUN.Common.EventBus.csproj" /> <ProjectReference Include="..\..\..\modules\common\LINGYUN.Common.EventBus\LINGYUN.Common.EventBus.csproj" />
<ProjectReference Include="..\..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.Application\LINGYUN.Abp.IdentityServer.Application.csproj" />
<ProjectReference Include="..\..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.HttpApi\LINGYUN.Abp.IdentityServer.HttpApi.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Pages\**\*.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Pages\**\*.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

34
aspnet-core/services/account/AuthServer.Host/Pages/Index.cshtml

@ -1,34 +0,0 @@
@page
@using AuthServer.Host.Pages
@using Volo.Abp.Users
@model IndexModel
@inject ICurrentUser CurrentUser
@if (CurrentUser.IsAuthenticated)
{
<div>
<abp-row>
<abp-column size-md="_3" class="text-center">
<i class="fa fa-user d-block" style="font-size: 10em; color: #12b900"></i>
<a abp-button="Primary" asp-controller="Logout" asp-action="Index" asp-area="Account">Logout</a>
</abp-column>
<abp-column size-md="_9">
<h2>@CurrentUser.UserName</h2>
<h5 class="text-muted">@CurrentUser.Email</h5>
<div>
<strong>Roles</strong>: @CurrentUser.Roles.JoinAsString(", ")
<br />
<strong>Claims</strong>: <br />
@Html.Raw(CurrentUser.GetAllClaims().Select(c => $"{c.Type}={c.Value}").JoinAsString(" <br /> "))
</div>
</abp-column>
</abp-row>
</div>
}
@if (!CurrentUser.IsAuthenticated)
{
<div class="text-center">
<i class="fa fa-user d-block" style="font-size: 10em; color: #aaa"></i><br/><br />
<a abp-button="Primary" asp-page="/Account/Login">Login</a>
</div>
}

11
aspnet-core/services/account/AuthServer.Host/Pages/Index.cshtml.cs

@ -1,11 +0,0 @@
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace AuthServer.Host.Pages
{
public class IndexModel : AbpPageModel
{
public void OnGet()
{
}
}
}

4
aspnet-core/services/account/AuthServer.Host/Pages/_ViewImports.cshtml

@ -1,4 +0,0 @@
@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

15
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/LINGYUN.Platform.HttpApi.Host.csproj

@ -23,12 +23,18 @@
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.4.1" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.4.1" />
<PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" Version="2.7.0" /> <PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" Version="2.7.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="2.7.0" />
<PackageReference Include="Volo.Abp.Autofac" Version="2.7.0" /> <PackageReference Include="Volo.Abp.Autofac" Version="2.7.0" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.MySQL" Version="2.7.0" /> <PackageReference Include="Volo.Abp.EntityFrameworkCore.MySQL" Version="2.7.0" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="2.7.0" /> <PackageReference Include="Volo.Abp.Identity.Application" Version="2.7.0" />
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="2.7.0" />
<PackageReference Include="Volo.Abp.Account.Application" Version="2.7.0" />
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="2.7.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="2.7.0" /> <PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="2.7.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.IdentityServer" Version="2.7.0" /> <PackageReference Include="Volo.Abp.PermissionManagement.Domain.IdentityServer" Version="2.7.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="2.7.0" /> <PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="2.7.0" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="2.7.0" />
<PackageReference Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="2.7.0" />
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="2.7.0" /> <PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="2.7.0" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="2.7.0" /> <PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="2.7.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="2.7.0" /> <PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="2.7.0" />
@ -37,7 +43,8 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\modules\apigateway\LINGYUN.ApiGateway.Application.Contracts\LINGYUN.ApiGateway.Application.Contracts.csproj" /> <ProjectReference Include="..\..\..\modules\apigateway\LINGYUN.ApiGateway.Application.Contracts\LINGYUN.ApiGateway.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" /> <ProjectReference Include="..\..\..\modules\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" />
<ProjectReference Include="..\..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.Application.Contracts\LINGYUN.Abp.IdentityServer.Application.Contracts.csproj" /> <ProjectReference Include="..\..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.Application\LINGYUN.Abp.IdentityServer.Application.csproj" />
<ProjectReference Include="..\..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.HttpApi\LINGYUN.Abp.IdentityServer.HttpApi.csproj" />
<ProjectReference Include="..\..\..\modules\permissions\LINGYUN.Abp.PermissionManagement.Application\LINGYUN.Abp.PermissionManagement.Application.csproj" /> <ProjectReference Include="..\..\..\modules\permissions\LINGYUN.Abp.PermissionManagement.Application\LINGYUN.Abp.PermissionManagement.Application.csproj" />
<ProjectReference Include="..\..\..\modules\settings\LINGYUN.Abp.SettingManagement.Application\LINGYUN.Abp.SettingManagement.Application.csproj" /> <ProjectReference Include="..\..\..\modules\settings\LINGYUN.Abp.SettingManagement.Application\LINGYUN.Abp.SettingManagement.Application.csproj" />
<ProjectReference Include="..\..\..\modules\settings\LINGYUN.Abp.SettingManagement.HttpApi\LINGYUN.Abp.SettingManagement.HttpApi.csproj" /> <ProjectReference Include="..\..\..\modules\settings\LINGYUN.Abp.SettingManagement.HttpApi\LINGYUN.Abp.SettingManagement.HttpApi.csproj" />
@ -45,4 +52,8 @@
<ProjectReference Include="..\..\..\modules\tenants\LINGYUN.Abp.TenantManagement.HttpApi\LINGYUN.Abp.TenantManagement.HttpApi.csproj" /> <ProjectReference Include="..\..\..\modules\tenants\LINGYUN.Abp.TenantManagement.HttpApi\LINGYUN.Abp.TenantManagement.HttpApi.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="EntityFrameworkCore\" />
</ItemGroup>
</Project> </Project>

19
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/PlatformHttpApiHostModule.cs

@ -17,11 +17,15 @@ using StackExchange.Redis;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Account;
using Volo.Abp.AspNetCore.Authentication.JwtBearer;
using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.MySQL; using Volo.Abp.EntityFrameworkCore.MySQL;
using Volo.Abp.Identity; using Volo.Abp.Identity;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.IdentityServer.EntityFrameworkCore;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
@ -41,18 +45,25 @@ namespace LINGYUN.Platform
typeof(AbpPermissionManagementDomainIdentityModule), typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpPermissionManagementDomainIdentityServerModule), typeof(AbpPermissionManagementDomainIdentityServerModule),
typeof(ApiGatewayApplicationContractsModule), typeof(ApiGatewayApplicationContractsModule),
typeof(AbpIdentityApplicationContractsModule), typeof(AbpIdentityHttpApiModule),
typeof(AbpIdentityServerApplicationContractsModule), typeof(AbpIdentityApplicationModule),
typeof(AbpAccountApplicationModule),
typeof(AbpAccountHttpApiModule),
typeof(AbpIdentityServerApplicationModule),
typeof(AbpIdentityServerHttpApiModule),
typeof(AbpSettingManagementApplicationModule), typeof(AbpSettingManagementApplicationModule),
typeof(AbpSettingManagementHttpApiModule), typeof(AbpSettingManagementHttpApiModule),
typeof(AbpPermissionManagementApplicationModule), typeof(AbpPermissionManagementApplicationModule),
typeof(AbpPermissionManagementHttpApiModule),
typeof(AbpTenantManagementApplicationModule), typeof(AbpTenantManagementApplicationModule),
typeof(AbpTenantManagementHttpApiModule), typeof(AbpTenantManagementHttpApiModule),
typeof(AbpPermissionManagementHttpApiModule),
typeof(AbpEntityFrameworkCoreMySQLModule), typeof(AbpEntityFrameworkCoreMySQLModule),
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpIdentityServerEntityFrameworkCoreModule),
typeof(AbpTenantManagementEntityFrameworkCoreModule), typeof(AbpTenantManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpCAPEventBusModule), typeof(AbpCAPEventBusModule),
typeof(AbpAutofacModule) typeof(AbpAutofacModule)
)] )]
@ -151,6 +162,8 @@ namespace LINGYUN.Platform
app.UseRouting(); app.UseRouting();
// 认证 // 认证
app.UseAuthentication(); app.UseAuthentication();
// jwt
app.UseJwtTokenMiddleware();
// 多租户 // 多租户
app.UseMultiTenancy(); app.UseMultiTenancy();
// Swagger // Swagger

1
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/tempkey.rsa

@ -0,0 +1 @@
{"KeyId":"UADq2_DSLpd3I00K3XOjqg","Parameters":{"D":"Byaqj2nCKV84tk4UcqS+s/X8aHpltuzywIOgB5ZIHEPPpYOyY053IA7Xs3CQFTo0/kRlcEmhOu4X4ctYbcDCNeUia2BEKQ3P7FQe/A8c+qkjAl7agTVoFlfwjtK/7z6rIi2WGLYMGL7oR7AjPUNDB7lTmmN5RDpPM+uCyetFp3S8cjimWiPi8miye6tpnNqYyNSah7rubTBNlgbjnZW0syfzm0zwY4ICh1vUHqYVk9yDfrSoco/j190z0Na6s0q4Kwbrz3zpAdGXWDnm1dAeJFIXwbTrv2eoAvFHSuh0/R3bldJOrorU/cE71+6TDwz6XCTCOa3+BEdu/ynDmSoV4Q==","DP":"hrKts8OotUvhGQfRyOFkyhJflqqqgy78YXZ5tOoyQsodZU4/cOfgLw7Ob9Buz305qHZEvb1SQhUCCgY52GDW7m9wTaldLNQ+g/9I4qVj5QtUxtH4xv4Ss3lmM2ZoAWD1vQJtTcUxFIcTlceuLp3FnuVWX05h3Pr7LuQOuC5rZ0c=","DQ":"C5df7OfbZyR5oRrLnjL6XpypKn3QnaQD3Sv5a7fJx9Y8wFFCC7w70raZtp9/7o9wWXMI38/6mGJ14XObZJDO7yjVOMg3X1SOAUkNd/Xxs67ibDCgcpWkW6mvDJwih2JH0emLUWHaIpmMjBWQbLQFCpkYE8SjCh69VcB1JKz8HTU=","Exponent":"AQAB","InverseQ":"XI07h975yuQgPyElSCIMCbNq+ZHX/7ue+YH+57OGRn83f+QWeJRaEOEtt0E0Y8D49yecdrZMntORCCD3/+HRpdUwX6ZXtSSuhnPiG4gV1/kqs1mNyg5HxDqwwUQje1HGnR8MvbTSkN6uIXwDSgHkrLjU3prlSSNQAVZxToDTNjk=","Modulus":"03z2iUdYKNL0n76zYEDZRAHkGNCoWuDFe6dXPqZRn2nPK9K0GfnPxYqZrccbeGiwkxs6w9H3SO7D6jE9H48+sHG2H7uOejh9Az1hD33PORT8tVsiM76ISfApcg6kvF93UWljnZcysN3sbgbOt71+CNIsykpbdcjx7sEBjS08YyvczNKmsSZZjEb6gnmQFwvN3Ih9PUIQYd+QqWbNWEuFYTvLIpIX7I3lAe9qBKWgg4wER+aLgiJ5YHxD0p3QXGJGsFmjp9zh2SKa6b/Y5jRwkAop5PAYZHW8lIkIaH9DYBk0D4b2wPifQQTL5QPTpdUrBXVNrSL5HftcB4TkDL/qVQ==","P":"12DITugP/tRWZhNxOTahc+ZNZJqhZIY72dFpu5T9if4dahvse4oPPuvENK7mr1jeCgfKNePOWp+IeQWaC8WCXaP9gi5MucLsdUiwWIfmu1vxzD0h1whGHQtCYUb0rMRj2LOyLXK5M3+PdFzJ4Zt0i80kNh55h0W5S7oBloOfhjM=","Q":"+2Bch4Vc7dx8fb+uFTp/4Wvnh/YZB1a0B3DjAJxWCSaCVY9dGRk08Mmmpcy2ItkcB73IVMjNX3mrR8rfUNUX4tbcuiZNjtGFfiQmtu2scTmc+lQWotMDVGB2c9EqfBZL6xthqrWU9lDpmtz46CYZS+nc1TI3zgBK7ViD6HX8dVc="}}

2
vueJs/src/api/roles.ts

@ -1,7 +1,7 @@
import ApiService from './serviceBase' import ApiService from './serviceBase'
import { ListResultDto } from './types' import { ListResultDto } from './types'
const IdentityServiceUrl = process.env.VUE_APP_BASE_IDENTITY_SERVICE const IdentityServiceUrl = process.env.VUE_APP_BASE_API
export default class RoleService { export default class RoleService {
public static getRoles() { public static getRoles() {

2
vueJs/src/api/users.ts

@ -3,7 +3,7 @@ import { pagerFormat } from '@/utils/index'
import { PagedAndSortedResultRequestDto, FullAuditedEntityDto, PagedResultDto } from '@/api/types' import { PagedAndSortedResultRequestDto, FullAuditedEntityDto, PagedResultDto } from '@/api/types'
import ApiService from './serviceBase' import ApiService from './serviceBase'
const IdentityServiceUrl = process.env.VUE_APP_BASE_IDENTITY_SERVICE const IdentityServiceUrl = process.env.VUE_APP_BASE_API
const IdentityServerUrl = process.env.VUE_APP_BASE_IDENTITY_SERVER const IdentityServerUrl = process.env.VUE_APP_BASE_IDENTITY_SERVER
export default class UserApiService { export default class UserApiService {

4
vueJs/src/lang/zh.ts

@ -290,6 +290,8 @@ export default {
updateRoute: '编辑路由', updateRoute: '编辑路由',
updateRouteByApp: '编辑路由 {name}', updateRouteByApp: '编辑路由 {name}',
deleteRoute: '删除路由', deleteRoute: '删除路由',
deleteRouteByName: '删除路由 {name}',
deleteRouteSuccess: '路由 {name} 已删除!',
groupName: '路由组名', groupName: '路由组名',
pleaseInputGroupName: '请输入路由组名称', pleaseInputGroupName: '请输入路由组名称',
appId: '应用标识', appId: '应用标识',
@ -555,7 +557,7 @@ export default {
deleteConnection: '删除连接', deleteConnection: '删除连接',
setTenantConnectionSuccess: '租户连接 {name} 已添加!', setTenantConnectionSuccess: '租户连接 {name} 已添加!',
deleteTenantConnectionName: '删除租户连接 {name}', deleteTenantConnectionName: '删除租户连接 {name}',
deleteTenantConnectionSuccess: '租户连接 {name} 已删除!', deleteTenantConnectionSuccess: '租户连接 {name} 已删除!'
}, },
global: { global: {
name: '名称', name: '名称',

313
vueJs/src/router/index.ts

@ -9,6 +9,10 @@ import Layout from '@/layout/index.vue'
// import chartsRouter from './modules/charts' // import chartsRouter from './modules/charts'
// import tableRouter from './modules/table' // import tableRouter from './modules/table'
// import nestedRouter from './modules/nested' // import nestedRouter from './modules/nested'
import taskRouter from './modules/task'
import adminRouter from './modules/admin'
import apigatewayRouter from './modules/apigateway'
import identityServerRouter from './modules/identityServer'
Vue.use(Router) Vue.use(Router)
@ -88,273 +92,10 @@ export const constantRoutes: RouteConfig[] = [
} }
} }
] ]
},
// // {
// // path: '/documentation',
// // component: Layout,
// // children: [
// // {
// // path: 'index',
// // component: () => import(/* webpackChunkName: "documentation" */ '@/views/documentation/index.vue'),
// // name: 'Documentation',
// // meta: { title: 'documentation', icon: 'documentation', affix: true }
// // }
// // ]
// // },
// {
// path: '/guide',
// component: Layout,
// redirect: '/guide/index',
// children: [
// {
// path: 'index',
// component: () => import(/* webpackChunkName: "guide" */ '@/views/guide/index.vue'),
// name: 'Guide',
// meta: {
// title: 'guide',
// icon: 'guide',
// noCache: true
// }
// }
// ]
// },
{
path: '/icon',
component: Layout,
children: [
{
path: 'index',
component: () => import(/* webpackChunkName: "icons" */ '@/views/icons/index.vue'),
name: 'Icons',
meta: {
title: 'icons',
icon: 'icon',
noCache: true
}
}
]
},
/** when your routing map is too long, you can split it into small modules **/
// componentsRouter,
// chartsRouter,
// nestedRouter,
// tableRouter,
{
path: '/error',
component: Layout,
redirect: 'noredirect',
meta: {
title: 'errorPages',
icon: '404'
},
children: [
{
path: '401',
component: () => import(/* webpackChunkName: "error-page-401" */ '@/views/error-page/401.vue'),
name: 'Page401',
meta: {
title: 'page401',
noCache: true
}
},
{
path: '404',
component: () => import(/* webpackChunkName: "error-page-404" */ '@/views/error-page/404.vue'),
name: 'Page404',
meta: {
title: 'page404',
noCache: true
}
}
]
} }
] ]
export const asyncRoutes: RouteConfig[] = [ export const asyncRoutes: RouteConfig[] = [
{
path: '/task',
component: Layout,
redirect: '/task',
meta: {
title: 'tasks',
icon: 'lock',
roles: ['AbpIdentity.Roles', 'TaskManagement.Task'], // you can set roles in root nav
alwaysShow: true // will always show the root menu
},
children: [
{
path: 'list',
component: () => import(/* webpackChunkName: "permission-page" */ '@/views/task/index.vue'),
name: 'tasks',
meta: {
title: 'tasks',
roles: ['AbpIdentity.Roles', 'TaskManagement.Task'] // or you can only set roles in sub nav
}
}
]
},
{
path: '/permission',
component: Layout,
redirect: '/permission/directive',
meta: {
title: 'permission',
icon: 'lock',
roles: ['admin', 'editor', 'AbpIdentity.Roles'], // you can set roles in root nav
alwaysShow: true // will always show the root menu
},
children: [
{
path: 'page',
component: () => import(/* webpackChunkName: "permission-page" */ '@/views/permission/page.vue'),
name: 'PagePermission',
meta: {
title: 'pagePermission',
roles: ['admin'] // or you can only set roles in sub nav
}
},
{
path: 'directive',
component: () => import(/* webpackChunkName: "permission-directive" */ '@/views/permission/directive.vue'),
name: 'DirectivePermission',
meta: {
title: 'directivePermission'
// if do not set roles, means: this page does not require permission
}
},
{
path: 'role',
component: () => import(/* webpackChunkName: "permission-role" */ '@/views/permission/role.vue'),
name: 'RolePermission',
meta: {
title: 'rolePermission',
roles: ['admin']
}
}
]
},
{
path: '/i18n',
component: Layout,
meta: {
roles: ['AbpIdentity.Roles']
},
children: [
{
path: 'index',
component: () => import('@/views/i18n-demo/index.vue'),
name: 'I18n',
meta: {
title: 'i18n',
icon: 'international'
}
}
]
},
{
path: '/apigateway',
component: Layout,
meta: {
title: 'apigateway',
icon: 'manager',
roles: ['ApiGateway.RouteGroup', 'ApiGateway.Global', 'ApiGateway.Route', 'ApiGateway.DynamicRoute', 'ApiGateway.AggregateRoute'],
alwaysShow: true
},
children: [
{
path: 'group',
component: () => import('@/views/admin/apigateway/group.vue'),
name: 'group',
meta: {
title: 'group',
icon: 'group',
roles: ['ApiGateway.RouteGroup']
}
},
{
path: 'global',
component: () => import('@/views/admin/apigateway/global.vue'),
name: 'global',
meta: {
title: 'global',
icon: 'global',
roles: ['ApiGateway.Global']
}
},
{
path: 'route',
component: () => import('@/views/admin/apigateway/route.vue'),
name: 'route',
meta: {
title: 'route',
icon: 'route',
roles: ['ApiGateway.Route']
}
},
{
path: 'aggregateRoute',
component: () => import('@/views/admin/apigateway/aggregateRoute.vue'),
name: 'aggregateRoute',
meta: {
title: 'aggregateRoute',
icon: 'aggregateRoute',
roles: ['ApiGateway.AggregateRoute']
}
}
]
},
{
path: '/admin',
component: Layout,
meta: {
title: 'admin',
icon: 'manager',
roles: ['AbpIdentity.Users', 'AbpIdentity.Roles', 'AbpSettingManagement.Settings', 'AbpTenantManagement.Tenants'], // you can set roles in root nav
alwaysShow: true // will always show the root menu
},
children: [
{
path: 'settings',
component: () => import('@/views/admin/settings/index.vue'),
name: 'settings',
meta: {
title: 'settings',
icon: 'setting',
roles: ['AbpSettingManagement.Settings']
}
},
{
path: 'users',
component: () => import('@/views/admin/users/index.vue'),
name: 'users',
meta: {
title: 'users',
icon: 'user',
roles: ['AbpIdentity.Users']
}
},
{
path: 'roles',
component: () => import('@/views/admin/roles/index.vue'),
name: 'roles',
meta: {
title: 'roles',
icon: 'role',
roles: ['AbpIdentity.Roles']
}
},
{
path: 'tenants',
component: () => import('@/views/admin/tenants/index.vue'),
name: 'tenants',
meta: {
title: 'tenants',
icon: 'tenants',
roles: ['AbpTenantManagement.Tenants']
}
}
]
},
{ {
path: '/profile', path: '/profile',
component: Layout, component: Layout,
@ -373,48 +114,10 @@ export const asyncRoutes: RouteConfig[] = [
} }
] ]
}, },
{ taskRouter,
path: '/identityServer', adminRouter,
component: Layout, apigatewayRouter,
meta: { identityServerRouter,
title: 'identityServer',
icon: 'manager',
roles: ['IdentityServer.Clients', 'IdentityServer.ApiResources', 'IdentityServer.IdentityResources'],
alwaysShow: true
},
children: [
{
path: 'clients',
component: () => import('@/views/admin/identityServer/client/index.vue'),
name: 'clients',
meta: {
title: 'clients',
icon: 'clients',
roles: ['IdentityServer.Clients']
}
},
{
path: 'apiresources',
component: () => import('@/views/admin/identityServer/api-resources/index.vue'),
name: 'apiresources',
meta: {
title: 'apiresources',
icon: 'apiresources',
roles: ['IdentityServer.ApiResources']
}
},
{
path: 'identityresources',
component: () => import('@/views/admin/identityServer/identity-resources/index.vue'),
name: 'identityresources',
meta: {
title: 'identityresources',
icon: 'identityresources',
roles: ['IdentityServer.IdentityResources']
}
}
]
},
{ {
path: '*', path: '*',
component: () => import(/* webpackChunkName: "error-page-404" */ '@/views/error-page/404.vue'), component: () => import(/* webpackChunkName: "error-page-404" */ '@/views/error-page/404.vue'),

57
vueJs/src/router/modules/admin.ts

@ -0,0 +1,57 @@
import { RouteConfig } from 'vue-router'
import Layout from '@/layout/index.vue'
const adminRouter: RouteConfig = {
path: '/admin',
component: Layout,
meta: {
title: 'admin',
icon: 'manager',
roles: ['AbpIdentity.Users', 'AbpIdentity.Roles', 'AbpSettingManagement.Settings', 'AbpTenantManagement.Tenants'], // you can set roles in root nav
alwaysShow: true // will always show the root menu
},
children: [
{
path: 'settings',
component: () => import('@/views/admin/settings/index.vue'),
name: 'settings',
meta: {
title: 'settings',
icon: 'setting',
roles: ['AbpSettingManagement.Settings']
}
},
{
path: 'users',
component: () => import('@/views/admin/users/index.vue'),
name: 'users',
meta: {
title: 'users',
icon: 'user',
roles: ['AbpIdentity.Users']
}
},
{
path: 'roles',
component: () => import('@/views/admin/roles/index.vue'),
name: 'roles',
meta: {
title: 'roles',
icon: 'role',
roles: ['AbpIdentity.Roles']
}
},
{
path: 'tenants',
component: () => import('@/views/admin/tenants/index.vue'),
name: 'tenants',
meta: {
title: 'tenants',
icon: 'tenants',
roles: ['AbpTenantManagement.Tenants']
}
}
]
}
export default adminRouter

57
vueJs/src/router/modules/apigateway.ts

@ -0,0 +1,57 @@
import { RouteConfig } from 'vue-router'
import Layout from '@/layout/index.vue'
const apigatewayRouter: RouteConfig = {
path: '/apigateway',
component: Layout,
meta: {
title: 'apigateway',
icon: 'manager',
roles: ['ApiGateway.RouteGroup', 'ApiGateway.Global', 'ApiGateway.Route', 'ApiGateway.DynamicRoute', 'ApiGateway.AggregateRoute'],
alwaysShow: true
},
children: [
{
path: 'group',
component: () => import('@/views/admin/apigateway/group.vue'),
name: 'group',
meta: {
title: 'group',
icon: 'group',
roles: ['ApiGateway.RouteGroup']
}
},
{
path: 'global',
component: () => import('@/views/admin/apigateway/global.vue'),
name: 'global',
meta: {
title: 'global',
icon: 'global',
roles: ['ApiGateway.Global']
}
},
{
path: 'route',
component: () => import('@/views/admin/apigateway/route.vue'),
name: 'route',
meta: {
title: 'route',
icon: 'route',
roles: ['ApiGateway.Route']
}
},
{
path: 'aggregateRoute',
component: () => import('@/views/admin/apigateway/aggregateRoute.vue'),
name: 'aggregateRoute',
meta: {
title: 'aggregateRoute',
icon: 'aggregateRoute',
roles: ['ApiGateway.AggregateRoute']
}
}
]
}
export default apigatewayRouter

47
vueJs/src/router/modules/identityServer.ts

@ -0,0 +1,47 @@
import { RouteConfig } from 'vue-router'
import Layout from '@/layout/index.vue'
const identityServerRouter: RouteConfig = {
path: '/identityServer',
component: Layout,
meta: {
title: 'identityServer',
icon: 'manager',
roles: ['IdentityServer.Clients', 'IdentityServer.ApiResources', 'IdentityServer.IdentityResources'],
alwaysShow: true
},
children: [
{
path: 'clients',
component: () => import('@/views/admin/identityServer/client/index.vue'),
name: 'clients',
meta: {
title: 'clients',
icon: 'clients',
roles: ['IdentityServer.Clients']
}
},
{
path: 'apiresources',
component: () => import('@/views/admin/identityServer/api-resources/index.vue'),
name: 'apiresources',
meta: {
title: 'apiresources',
icon: 'apiresources',
roles: ['IdentityServer.ApiResources']
}
},
{
path: 'identityresources',
component: () => import('@/views/admin/identityServer/identity-resources/index.vue'),
name: 'identityresources',
meta: {
title: 'identityresources',
icon: 'identityresources',
roles: ['IdentityServer.IdentityResources']
}
}
]
}
export default identityServerRouter

27
vueJs/src/router/modules/task.ts

@ -0,0 +1,27 @@
import { RouteConfig } from 'vue-router'
import Layout from '@/layout/index.vue'
const taskRouter: RouteConfig = {
path: '/task',
component: Layout,
redirect: '/task',
meta: {
title: 'tasks',
icon: 'lock',
roles: ['AbpIdentity.Roles', 'TaskManagement.Task'], // you can set roles in root nav
alwaysShow: true // will always show the root menu
},
children: [
{
path: 'list',
component: () => import(/* webpackChunkName: "permission-page" */ '@/views/task/index.vue'),
name: 'tasks',
meta: {
title: 'tasks',
roles: ['AbpIdentity.Roles', 'TaskManagement.Task'] // or you can only set roles in sub nav
}
}
]
}
export default taskRouter

20
vueJs/src/views/admin/apigateway/route.vue

@ -178,7 +178,7 @@
:disabled="!checkPermission(['ApiGateway.Route.Delete'])" :disabled="!checkPermission(['ApiGateway.Route.Delete'])"
size="mini" size="mini"
type="warning" type="warning"
@click="handleCreateOrEditRoute(row.reRouteId, row.reRouteName)" @click="handleDeleteRoute(row.reRouteId, row.reRouteName)"
> >
{{ $t('apiGateWay.deleteRoute') }} {{ $t('apiGateWay.deleteRoute') }}
</el-button> </el-button>
@ -290,6 +290,20 @@ export default class extends Vue {
this.routeGetPagedFilter.sorting = column.prop this.routeGetPagedFilter.sorting = column.prop
} }
private handleDeleteRoute(reRouteId: number, reRouteName: string) {
this.$confirm(this.l('apiGateWay.deleteRouteByName', { name: reRouteName }),
this.l('apiGateWay.deleteRoute'), {
callback: (action) => {
if (action === 'confirm') {
ApiGatewayService.deleteReRoute(reRouteId).then(() => {
this.$message.success(this.l('apiGateWay.deleteRouteSuccess', { name: reRouteName }))
this.handleGetRoutes()
})
}
}
})
}
private handleCreateOrEditRoute(reRouteId: number, reRouteName: string) { private handleCreateOrEditRoute(reRouteId: number, reRouteName: string) {
this.editRouteId = reRouteId this.editRouteId = reRouteId
this.editRouteTitle = this.$t('apiGateWay.createRoute') this.editRouteTitle = this.$t('apiGateWay.createRoute')
@ -307,5 +321,9 @@ export default class extends Vue {
this.handleGetRoutes() this.handleGetRoutes()
} }
} }
private l(name: string, values?: any[] | { [key: string]: any }) {
return this.$t(name, values).toString()
}
} }
</script> </script>

4
vueJs/src/views/admin/identityServer/identity-resources/components/IdentityResourceCreateOrEditForm.vue

@ -21,7 +21,7 @@
> >
<el-input <el-input
v-model="identityResource.name" v-model="identityResource.name"
:readonly="isEdit" :disabled="isEdit"
:placeholder="$t('pleaseInputBy', {key: $t('identityServer.resourceName')})" :placeholder="$t('pleaseInputBy', {key: $t('identityServer.resourceName')})"
/> />
</el-form-item> </el-form-item>
@ -176,6 +176,8 @@ export default class extends Vue {
public resetFields() { public resetFields() {
this.identityResource = IdentityResource.empty() this.identityResource = IdentityResource.empty()
const frmIdentityResource = this.$refs.formIdentityResource as any
frmIdentityResource.resetFields()
} }
private l(name: string, values?: any[] | { [key: string]: any }) { private l(name: string, values?: any[] | { [key: string]: any }) {

Loading…
Cancel
Save