Browse Source

集成Ocelot网关,Consul 服务注册和发现

pull/8/head
王军 4 years ago
parent
commit
1ce7b17c69
  1. 7
      aspnet-core/CompanyName.ProjectName.sln
  2. 11
      aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/CompanyName.ProjectName.PublicGateway.csproj
  3. 40
      aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/Controllers/WeatherForecastController.cs
  4. 23
      aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/Program.cs
  5. 31
      aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/Properties/launchSettings.json
  6. 58
      aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/Startup.cs
  7. 15
      aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/WeatherForecast.cs
  8. 9
      aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/appsettings.Development.json
  9. 10
      aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/appsettings.json
  10. 4
      aspnet-core/gateways/CompanyName.ProjectName.WebGateway/Properties/launchSettings.json
  11. 2
      aspnet-core/gateways/CompanyName.ProjectName.WebGateway/appsettings.Consul.json
  12. 2
      aspnet-core/gateways/CompanyName.ProjectName.WebGateway/appsettings.Development.json
  13. 5
      aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.cs
  14. 17
      aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Properties/launchSettings.json
  15. 61
      aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/appsettings.Consul.json
  16. 2
      aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/appsettings.Development.json
  17. 2
      aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/appsettings.json
  18. 2
      aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/appsettings.secrets.json
  19. 6
      aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/Properties/launchSettings.json
  20. 17
      aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/appsettings.json
  21. 2
      aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/appsettings.secrets.json
  22. 34
      aspnet-core/services/src/CompanyName.ProjectName.HttpApi/AbpApplicationConfigurationController.cs
  23. 2
      aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/IdentityServers/ApiResourceController.cs
  24. 2
      aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/IdentityServers/ApiScopeController.cs
  25. 2
      aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/IdentityServers/ClientController.cs
  26. 2
      aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/IdentityServers/IdentityResourceController.cs
  27. 5
      aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/AccountController.cs
  28. 4
      aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/AuditLogController.cs
  29. 2
      aspnet-core/shared/CompanyName.ProjectName.Shared.Hosting.Microservices/SharedHostingMicroserviceModule.cs
  30. 2
      aspnet-core/shared/CompanyName.ProjectName.Shared.Hosting.Microservices/Swaggers/EnumSchemaFilter.cs
  31. 2
      aspnet-core/shared/CompanyName.ProjectName.Shared.Hosting.Microservices/Swaggers/HiddenAbpDefaultApiFilter.cs
  32. 4
      vben271/.env.development
  33. 4
      vben271/src/hooks/web/useSignalR.ts
  34. 13
      vben271/src/store/modules/permission.ts
  35. 1
      vben271/src/views/identityServers/clients/ClientUri.vue

7
aspnet-core/CompanyName.ProjectName.sln

@ -139,8 +139,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lion.Abp.Extension", "frame
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gateways", "gateways", "{5C304CBC-F30D-413C-A0AF-8B6814A2D4A3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompanyName.ProjectName.PublicGateway", "gateways\CompanyName.ProjectName.PublicGateway\CompanyName.ProjectName.PublicGateway.csproj", "{870364BA-DD5C-4597-9047-BD8A0CA1CFBA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompanyName.ProjectName.WebGateway", "gateways\CompanyName.ProjectName.WebGateway\CompanyName.ProjectName.WebGateway.csproj", "{D9108313-8D05-4F5F-9AA0-B443EC3374B6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompanyName.ProjectName.FreeSqlRepository", "services\src\CompanyName.ProjectName.FreeSqlRepository\CompanyName.ProjectName.FreeSqlRepository.csproj", "{FC30B17B-F671-4E55-90C6-9F37E40B483D}"
@ -323,10 +321,6 @@ Global
{6848FA46-EFFF-4E0C-8EAA-145D8C440333}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6848FA46-EFFF-4E0C-8EAA-145D8C440333}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6848FA46-EFFF-4E0C-8EAA-145D8C440333}.Release|Any CPU.Build.0 = Release|Any CPU
{870364BA-DD5C-4597-9047-BD8A0CA1CFBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{870364BA-DD5C-4597-9047-BD8A0CA1CFBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{870364BA-DD5C-4597-9047-BD8A0CA1CFBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{870364BA-DD5C-4597-9047-BD8A0CA1CFBA}.Release|Any CPU.Build.0 = Release|Any CPU
{D9108313-8D05-4F5F-9AA0-B443EC3374B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D9108313-8D05-4F5F-9AA0-B443EC3374B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D9108313-8D05-4F5F-9AA0-B443EC3374B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -399,7 +393,6 @@ Global
{48D938A1-36E4-4AC1-9AF2-645CB75D4A05} = {1A57338B-65B1-4B8F-ABBD-83F4E8321D8F}
{800F4482-EAC3-472B-AF07-53980D47AA41} = {11ED8435-B5AE-4BF3-9D4B-51FA1E4A18A6}
{6848FA46-EFFF-4E0C-8EAA-145D8C440333} = {C4AC9352-C9F5-4096-8D73-13638232CFB9}
{870364BA-DD5C-4597-9047-BD8A0CA1CFBA} = {5C304CBC-F30D-413C-A0AF-8B6814A2D4A3}
{D9108313-8D05-4F5F-9AA0-B443EC3374B6} = {5C304CBC-F30D-413C-A0AF-8B6814A2D4A3}
{FC30B17B-F671-4E55-90C6-9F37E40B483D} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
EndGlobalSection

11
aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/CompanyName.ProjectName.PublicGateway.csproj

@ -1,11 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3"/>
</ItemGroup>
</Project>

40
aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/Controllers/WeatherForecastController.cs

@ -1,40 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace CompanyName.ProjectName.PublicGateway.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering",
"Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet]
public IEnumerable<WeatherForecast> Get()
{
var rng = new Random();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]
})
.ToArray();
}
}
}

23
aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/Program.cs

@ -1,23 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace CompanyName.ProjectName.PublicGateway
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
}
}

31
aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/Properties/launchSettings.json

@ -1,31 +0,0 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:29877",
"sslPort": 44344
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"CompanyName.ProjectName.PublicGateway": {
"commandName": "Project",
"dotnetRunMessages": "true",
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

58
aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/Startup.cs

@ -1,58 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.OpenApi.Models;
namespace CompanyName.ProjectName.PublicGateway
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1",
new OpenApiInfo
{ Title = "CompanyName.ProjectName.PublicGateway", Version = "v1" });
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseSwagger();
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json",
"CompanyName.ProjectName.PublicGateway v1"));
}
app.UseHttpsRedirection();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
}
}
}

15
aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/WeatherForecast.cs

@ -1,15 +0,0 @@
using System;
namespace CompanyName.ProjectName.PublicGateway
{
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string Summary { get; set; }
}
}

9
aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/appsettings.Development.json

@ -1,9 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

10
aspnet-core/gateways/CompanyName.ProjectName.PublicGateway/appsettings.json

@ -1,10 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}

4
aspnet-core/gateways/CompanyName.ProjectName.WebGateway/Properties/launchSettings.json

@ -3,11 +3,11 @@
"profiles": {
"CompanyName.ProjectName.WebGateway": {
"commandName": "Project",
"launchBrowser": true,
"launchBrowser": false,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:44314",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Consul"
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}

2
aspnet-core/gateways/CompanyName.ProjectName.WebGateway/appsettings.Consul.json

@ -36,7 +36,7 @@
"LoadBalancerOptions": {
"Type": "LeastConnection"
},
"UpstreamPathTemplate": "/{url}",
"UpstreamPathTemplate": "/gateway/{url}",
"UpstreamHttpMethod": [
"Get",
"Post",

2
aspnet-core/gateways/CompanyName.ProjectName.WebGateway/appsettings.Development.json

@ -40,7 +40,7 @@
"Port": 44315
}
],
"UpstreamPathTemplate": "/{url}",
"UpstreamPathTemplate": "/gateway/{url}",
"UpstreamHttpMethod": [
"Get",
"Post",

5
aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.cs

@ -31,8 +31,7 @@ using Volo.Abp.Swashbuckle;
using System.Threading.Tasks;
using CompanyName.ProjectName.Extensions;
using CompanyName.ProjectName.MultiTenancy;
using DefaultNamespace;
using DefaultNamespace.Swaggers;
using CompanyName.ProjectName.Swaggers;
using Lion.Abp.Cap;
using Savorboard.CAP.InMemoryMessageQueue;
using Serilog;
@ -79,6 +78,8 @@ namespace CompanyName.ProjectName
ConfigureHangfireMysql(context);
ConfigurationCap(context);
ConfigurationStsHttpClient(context);
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)

17
aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Properties/launchSettings.json

@ -1,23 +1,8 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://localhost:44315",
"sslPort": 44315
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"CompanyName.ProjectName.HttpApi.Host": {
"commandName": "Project",
"launchBrowser": true,
"launchBrowser": false,
"applicationUrl": "http://localhost:44315",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"

61
aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/appsettings.Consul.json

@ -0,0 +1,61 @@
{
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Information",
"Volo.Abp": "Information",
"Hangfire": "Information",
"DotNetCore.CAP": "Information",
"Serilog.AspNetCore": "Information"
}
}
},
"App": {
"SelfUrl": "http://localhost:44315",
"CorsOrigins": "https://*.ProjectName.com,http://localhost:4200,http://localhost:3100"
},
"ConnectionStrings": {
"Default": "Data Source=localhost;Database=CompanyNameProjectNameDB20211106;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true"
},
"Redis": {
"Configuration": "localhost,password=mypassword,defaultdatabase=1"
},
"Jwt": {
"Audience": "CompanyNameProjectName",
//
"SecurityKey": "dzehzRz9a8asdfasfdadfasdfasdfafsdadfasbasdf=",
"Issuer": "CompanyNameProjectName",
//
"ExpirationTime": 24
// hour
},
"Cap": {
"Enabled": "false",
"RabbitMq": {
"HostName": "localhost",
"UserName": "admin",
"Password": "admin"
}
},
"LogToElasticSearch": {
"Enabled": "false",
"ElasticSearch": {
"Url": "http://es.cn",
"IndexFormat": "companyname.projectname.development",
"UserName": "elastic",
"Password": "aVVhjQ95RP7nbwNy",
"DashboardIndex": "companyname.projectname"
}
},
"HttpClient": {
"Sts": {
"Url": "http://localhost:44354"
}
},
"Consul": {
"Enabled": true,
"Host": "http://localhost:8500",
"Service": "Project-Service"
}
}

2
aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/appsettings.Development.json

@ -54,7 +54,7 @@
}
},
"Consul": {
"Enabled": true,
"Enabled": false,
"Host": "http://localhost:8500",
"Service": "Project-Service"
}

2
aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/appsettings.json

@ -1,2 +0,0 @@
{
}

2
aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/appsettings.secrets.json

@ -1,2 +0,0 @@
{
}

6
aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/Properties/launchSettings.json

@ -1,13 +1,11 @@
{
"profiles": {
"CompanyName.ProjectName.IdentityServer": {
"commandName": "Project",
"launchBrowser": true,
"launchBrowser": false,
"applicationUrl": "http://localhost:44354",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production"
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}

17
aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/appsettings.json

@ -1,17 +0,0 @@
{
"App": {
"SelfUrl": "https://localhost:44354",
"ClientUrl": "http://localhost:4200",
"CorsOrigins": "https://*.ProjectName.com,http://localhost:4200,https://localhost:44307,https://localhost:44315",
"RedirectAllowedUrls": "http://localhost:4200,https://localhost:44307"
},
"ConnectionStrings": {
"Default": "Data Source=localhost;Database=CompanyNameProjectNameDB;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true"
},
"Redis": {
"Configuration": "localhost,password=mypassword"
},
"StringEncryption": {
"DefaultPassPhrase": "YFLtqf75HkDnKR0n"
}
}

2
aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/appsettings.secrets.json

@ -1,2 +0,0 @@
{
}

34
aspnet-core/services/src/CompanyName.ProjectName.HttpApi/AbpApplicationConfigurationController.cs

@ -0,0 +1,34 @@
// using System.Threading.Tasks;
// using Microsoft.AspNetCore.Mvc;
// using Volo.Abp.Application.Services;
// using Volo.Abp.AspNetCore.Mvc;
// using Volo.Abp.AspNetCore.Mvc.AntiForgery;
// using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
// using Volo.Abp.DependencyInjection;
//
// namespace CompanyName.ProjectName.WebGateway.Controllers
// {
// [Dependency(ReplaceServices = true)]
// [ExposeServices(typeof(IAbpApplicationConfigurationAppService))]
// [Route("ProjectName")]
// public class ProjectNameAbpApplicationConfigurationController : AbpController,IAbpApplicationConfigurationAppService
// {
// private readonly IAbpApplicationConfigurationAppService _applicationConfigurationAppService;
// private readonly IAbpAntiForgeryManager _antiForgeryManager;
//
// public ProjectNameAbpApplicationConfigurationController(
// IAbpApplicationConfigurationAppService applicationConfigurationAppService,
// IAbpAntiForgeryManager antiForgeryManager)
// {
// _applicationConfigurationAppService = applicationConfigurationAppService;
// _antiForgeryManager = antiForgeryManager;
// }
//
// [HttpGet("api/abp/application-configuration")]
// public async Task<ApplicationConfigurationDto> GetAsync()
// {
// _antiForgeryManager.SetCookie();
// return await _applicationConfigurationAppService.GetAsync();
// }
// }
// }

2
aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/IdentityServers/ApiResourceController.cs

@ -13,7 +13,7 @@ namespace CompanyName.ProjectName.Controllers.IdentityServers
{
[Route("IdentityServer/ApiResource")]
[Authorize(Policy = ProjectNamePermissions.IdentityServer.ApiResource.Default)]
public class ApiResourceController : ProjectNameController
public class ApiResourceController : ProjectNameController,IApiResourceAppService
{
private readonly IApiResourceAppService _apiResourceAppService;

2
aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/IdentityServers/ApiScopeController.cs

@ -13,7 +13,7 @@ namespace CompanyName.ProjectName.Controllers.IdentityServers
{
[Route("IdentityServer/ApiScope")]
[Authorize(Policy = ProjectNamePermissions.IdentityServer.ApiScope.Default)]
public class ApiScopeController:ProjectNameController
public class ApiScopeController:ProjectNameController,IApiScopeAppService
{
private readonly IApiScopeAppService _apiScopeAppService;

2
aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/IdentityServers/ClientController.cs

@ -11,7 +11,7 @@ namespace CompanyName.ProjectName.Controllers.IdentityServers
{
[Route("IdentityServer/Client")]
[Authorize(Policy = ProjectNamePermissions.IdentityServer.Client.Default)]
public class ClientController : ProjectNameController
public class ClientController : ProjectNameController,IIdentityServerClientAppService
{
private readonly IIdentityServerClientAppService _identityServerClientAppService;

2
aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/IdentityServers/IdentityResourceController.cs

@ -13,7 +13,7 @@ namespace CompanyName.ProjectName.Controllers.IdentityServers
{
[Route("IdentityServer/IdentityResource")]
[Authorize(Policy = ProjectNamePermissions.IdentityServer.IdentityResources.Default)]
public class IdentityResourceController : ProjectNameController
public class IdentityResourceController : ProjectNameController,IIdentityResourceAppService
{
private readonly IIdentityResourceAppService _identityResourceAppService;

5
aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/AccountController.cs

@ -6,10 +6,7 @@ using Swashbuckle.AspNetCore.Annotations;
namespace CompanyName.ProjectName.Controllers.Systems
{
/// <summary>
/// 登录
/// </summary>
public class AccountController : ProjectNameController
public class AccountController : ProjectNameController,ILoginAppService
{
private readonly ILoginAppService _loginAppService;

4
aspnet-core/services/src/CompanyName.ProjectName.HttpApi/Controllers/Systems/AuditLogController.cs

@ -12,7 +12,7 @@ namespace CompanyName.ProjectName.Controllers.Systems
{
[Route("AuditLogs")]
[Authorize(Policy = IdentityPermissions.Users.Default)]
public class AuditLogController : ProjectNameController
public class AuditLogController : ProjectNameController,IAuditLogAppService
{
private readonly IAuditLogAppService _auditLogAppService;
@ -24,7 +24,7 @@ namespace CompanyName.ProjectName.Controllers.Systems
[HttpPost("page")]
[Authorize(Policy = ProjectNamePermissions.SystemManagement.AuditLog)]
[SwaggerOperation(summary: "分页获取用户信息", Tags = new[] {"AuditLogs"})]
public Task<PagedResultDto<GetAuditLogPageListOutput>> ListAsync(PagingAuditLogListInput input)
public Task<PagedResultDto<GetAuditLogPageListOutput>> GetListAsync(PagingAuditLogListInput input)
{
return _auditLogAppService.GetListAsync(input);
}

2
aspnet-core/shared/CompanyName.ProjectName.Shared.Hosting.Microservices/SharedHostingMicroserviceModule.cs

@ -10,7 +10,7 @@ using Volo.Abp.Modularity;
using Volo.Abp.Swashbuckle;
using Volo.Abp.UI.Navigation.Urls;
namespace DefaultNamespace
namespace CompanyName.ProjectName
{
[DependsOn(
typeof(AbpSwashbuckleModule),

2
aspnet-core/shared/CompanyName.ProjectName.Shared.Hosting.Microservices/Swaggers/EnumSchemaFilter.cs

@ -4,7 +4,7 @@ using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
namespace DefaultNamespace.Swaggers
namespace CompanyName.ProjectName.Swaggers
{
/// <summary>
/// swagger 枚举映射,

2
aspnet-core/shared/CompanyName.ProjectName.Shared.Hosting.Microservices/Swaggers/HiddenAbpDefaultApiFilter.cs

@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
namespace DefaultNamespace.Swaggers
namespace CompanyName.ProjectName.Swaggers
{
/// <summary>
/// 在使用nswag的时候,原生默认的api导致生产的代理类存在问题

4
vben271/.env.development

@ -24,8 +24,8 @@ VITE_GLOB_API_URL_PREFIX=
VITE_BUILD_COMPRESS = 'none'
# 认证授权服务器地址
VITE_AUTH_URL='http://localhost:44354'
VITE_AUTH_URL= http://localhost:44354
# 接口地址
VITE_API_URL= http://localhost:44315
VITE_API_URL= http://localhost:44314/gateway

4
vben271/src/hooks/web/useSignalR.ts

@ -22,7 +22,7 @@ export function useSignalR() {
const userStore = useUserStoreWithOut();
const token = userStore.getToken;
const url = (import.meta.env.VITE_Websocket_URL as string) + '/signalr/notification';
const url = (import.meta.env.VITE_API_URL as string) + '/signalr/notification';
const connection = new signalR.HubConnectionBuilder()
.withUrl(url, {
accessTokenFactory: () => token,
@ -45,7 +45,7 @@ export function useSignalR() {
}
},
})
.configureLogging(signalR.LogLevel.Error)
.configureLogging(signalR.LogLevel.Debug)
.build();
return connection;
}

13
vben271/src/store/modules/permission.ts

@ -164,19 +164,6 @@ export const usePermissionStore = defineStore({
break;
case PermissionModeEnum.ROUTE_MAPPING:
// routes = filter(asyncRoutes, routeFilter);
// routes = routes.filter(routeFilter);
// const menuList = transformRouteToMenu(routes, true);
// routes = filter(routes, routeRemoveIgnoreFilter);
// routes = routes.filter(routeRemoveIgnoreFilter);
// menuList.sort((a, b) => {
// return (a.meta?.orderNo || 0) - (b.meta?.orderNo || 0);
// });
// this.setFrontMenuList(menuList);
// // Convert multi-level routing to level 2 routing
// routes = flatMultiLevelRoutes(routes);
debugger;
const permissions = this.getPermCodeList;
const roleRouteFilter = (route: AppRouteRecordRaw) => {
const { meta } = route;

1
vben271/src/views/identityServers/clients/ClientUri.vue

@ -122,7 +122,6 @@
};
const handleRemoveLogoutRedirectUri = async (redirectUri: string) => {
debugger;
await removeLogoutRedirectUriAsync({
clientId: state.currentClient.clientId,
uri: redirectUri,

Loading…
Cancel
Save