Browse Source

Merge branch 'dev' into adding-widget-to-editor

pull/13242/head
malik masis 4 years ago
parent
commit
e5579b3b35
  1. 2
      docs/en/CLI.md
  2. 10
      docs/zh-Hans/CLI.md
  3. 12
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
  4. 29
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs
  5. 14
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeApplicationIdGuidStep.cs
  6. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Events/ProjectCreationProgressEvent.cs
  7. 17
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs
  8. 4
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs
  9. 34
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Maui/MauiChangeApplicationIdGuidStep.cs
  10. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Maui/MauiTemplateBase.cs
  11. 4
      framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs
  12. 13
      modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20220623064459_Initial.Designer.cs
  13. 2
      modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20220623064459_Initial.cs
  14. 11
      modules/openiddict/app/OpenIddict.Demo.Server/Migrations/ServerDbContextModelSnapshot.cs
  15. 19
      modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/LogoutController.cs
  16. 22
      modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Views/Logout/Logout.cshtml
  17. 6
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/el.json
  18. 4
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/en.json
  19. 6
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/pt-BR.json
  20. 4
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/tr.json
  21. 4
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hans.json
  22. 4
      modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hant.json

2
docs/en/CLI.md

@ -219,7 +219,7 @@ Example:
abp add-package Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic abp add-package Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic
```` ````
* This example adds the Volo.Abp.MongoDB package to the project. * This example adds the `Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic` package to the project.
#### Options #### Options

10
docs/zh-Hans/CLI.md

@ -190,10 +190,10 @@ abp add-package <包名> [options]
示例: 示例:
```` ````
abp add-package Volo.Abp.MongoDB abp add-package Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic
```` ````
* 示例中将Volo.Abp.MongoDB包添加到项目中. * 示例中将`Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic`包添加到项目中.
#### Options #### Options
@ -201,6 +201,12 @@ abp add-package Volo.Abp.MongoDB
* `--with-source-code`: 下载包的源码到你的解决方案文件夹,而不是NuGet/NPM软件包. * `--with-source-code`: 下载包的源码到你的解决方案文件夹,而不是NuGet/NPM软件包.
* `--add-to-solution-file`: 添加下载/创建的包添加到解决方案文件中,你在IDE中打开解决方案时也会看到包的项目. (仅当 `--with-source-code` 为 `True` 时可用.) * `--add-to-solution-file`: 添加下载/创建的包添加到解决方案文件中,你在IDE中打开解决方案时也会看到包的项目. (仅当 `--with-source-code` 为 `True` 时可用.)
> 当前只有基本主题包([MVC](https://docs.abp.io/zh-Hans/abp/latest/UI/AspNetCore/Basic-Theme) 和 [Blazor](https://docs.abp.io/zh-Hans/abp/latest/UI/Blazor/Basic-Theme)) 可以下载.
> - Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic
> - Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme
> - Volo.Abp.AspNetCore.Components.Web.BasicTheme
> - Volo.Abp.AspNetCore.Components.Server.BasicTheme
### add-module ### add-module
通过查找模块的所有包,查找解决方案中的相关项目,并将每个包添加到解决方案中的相应项目,从而将[多包应用程序模块](Modules/Index)添加到解决方案中. 通过查找模块的所有包,查找解决方案中的相关项目,并将每个包添加到解决方案中的相应项目,从而将[多包应用程序模块](Modules/Index)添加到解决方案中.

12
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs

@ -16,13 +16,14 @@ using Volo.Abp.Cli.ProjectBuilding.Building;
using Volo.Abp.Cli.ProjectModification; using Volo.Abp.Cli.ProjectModification;
using Volo.Abp.Cli.Utils; using Volo.Abp.Cli.Utils;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Local;
namespace Volo.Abp.Cli.Commands; namespace Volo.Abp.Cli.Commands;
public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransientDependency public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransientDependency
{ {
public const string Name = "new"; public const string Name = "new";
protected TemplateProjectBuilder TemplateProjectBuilder { get; } protected TemplateProjectBuilder TemplateProjectBuilder { get; }
public ITemplateInfoProvider TemplateInfoProvider { get; } public ITemplateInfoProvider TemplateInfoProvider { get; }
@ -34,8 +35,9 @@ public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransien
IInstallLibsService installLibsService, IInstallLibsService installLibsService,
AngularPwaSupportAdder angularPwaSupportAdder, AngularPwaSupportAdder angularPwaSupportAdder,
InitialMigrationCreator initialMigrationCreator, InitialMigrationCreator initialMigrationCreator,
ThemePackageAdder themePackageAdder) ThemePackageAdder themePackageAdder,
: base(connectionStringProvider, solutionPackageVersionFinder, cmdHelper, installLibsService, angularPwaSupportAdder, initialMigrationCreator, themePackageAdder) ILocalEventBus eventBus)
: base(connectionStringProvider, solutionPackageVersionFinder, cmdHelper, installLibsService, angularPwaSupportAdder, initialMigrationCreator, themePackageAdder, eventBus)
{ {
TemplateProjectBuilder = templateProjectBuilder; TemplateProjectBuilder = templateProjectBuilder;
TemplateInfoProvider = templateInfoProvider; TemplateInfoProvider = templateInfoProvider;
@ -81,10 +83,10 @@ public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransien
Logger.LogInformation($"'{projectName}' has been successfully created to '{projectArgs.OutputFolder}'"); Logger.LogInformation($"'{projectName}' has been successfully created to '{projectArgs.OutputFolder}'");
ConfigureNpmPackagesForTheme(projectArgs); ConfigureNpmPackagesForTheme(projectArgs);
RunGraphBuildForMicroserviceServiceTemplate(projectArgs); await RunGraphBuildForMicroserviceServiceTemplate(projectArgs);
await CreateInitialMigrationsAsync(projectArgs); await CreateInitialMigrationsAsync(projectArgs);
await RunInstallLibsForWebTemplateAsync(projectArgs); await RunInstallLibsForWebTemplateAsync(projectArgs);
ConfigurePwaSupportForAngular(projectArgs); await ConfigurePwaSupportForAngular(projectArgs);
OpenRelatedWebPage(projectArgs, template, isTiered, commandLineArgs); OpenRelatedWebPage(projectArgs, template, isTiered, commandLineArgs);
} }

29
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs

@ -14,10 +14,12 @@ using Volo.Abp.Cli.Commands.Services;
using Volo.Abp.Cli.LIbs; using Volo.Abp.Cli.LIbs;
using Volo.Abp.Cli.ProjectBuilding; using Volo.Abp.Cli.ProjectBuilding;
using Volo.Abp.Cli.ProjectBuilding.Building; using Volo.Abp.Cli.ProjectBuilding.Building;
using Volo.Abp.Cli.ProjectBuilding.Events;
using Volo.Abp.Cli.ProjectBuilding.Templates.App; using Volo.Abp.Cli.ProjectBuilding.Templates.App;
using Volo.Abp.Cli.ProjectBuilding.Templates.Microservice; using Volo.Abp.Cli.ProjectBuilding.Templates.Microservice;
using Volo.Abp.Cli.ProjectBuilding.Templates.Module; using Volo.Abp.Cli.ProjectBuilding.Templates.Module;
using Volo.Abp.Cli.Utils; using Volo.Abp.Cli.Utils;
using Volo.Abp.EventBus.Local;
namespace Volo.Abp.Cli.Commands; namespace Volo.Abp.Cli.Commands;
@ -29,6 +31,7 @@ public abstract class ProjectCreationCommandBase
public IInstallLibsService InstallLibsService { get; } public IInstallLibsService InstallLibsService { get; }
public AngularPwaSupportAdder AngularPwaSupportAdder { get; } public AngularPwaSupportAdder AngularPwaSupportAdder { get; }
public InitialMigrationCreator InitialMigrationCreator { get; } public InitialMigrationCreator InitialMigrationCreator { get; }
public ILocalEventBus EventBus { get; }
public ILogger<NewCommand> Logger { get; set; } public ILogger<NewCommand> Logger { get; set; }
public ThemePackageAdder ThemePackageAdder { get; } public ThemePackageAdder ThemePackageAdder { get; }
@ -40,7 +43,8 @@ public abstract class ProjectCreationCommandBase
IInstallLibsService installLibsService, IInstallLibsService installLibsService,
AngularPwaSupportAdder angularPwaSupportAdder, AngularPwaSupportAdder angularPwaSupportAdder,
InitialMigrationCreator initialMigrationCreator, InitialMigrationCreator initialMigrationCreator,
ThemePackageAdder themePackageAdder) ThemePackageAdder themePackageAdder,
ILocalEventBus eventBus)
{ {
ConnectionStringProvider = connectionStringProvider; ConnectionStringProvider = connectionStringProvider;
SolutionPackageVersionFinder = solutionPackageVersionFinder; SolutionPackageVersionFinder = solutionPackageVersionFinder;
@ -48,6 +52,7 @@ public abstract class ProjectCreationCommandBase
InstallLibsService = installLibsService; InstallLibsService = installLibsService;
AngularPwaSupportAdder = angularPwaSupportAdder; AngularPwaSupportAdder = angularPwaSupportAdder;
InitialMigrationCreator = initialMigrationCreator; InitialMigrationCreator = initialMigrationCreator;
EventBus = eventBus;
ThemePackageAdder = themePackageAdder; ThemePackageAdder = themePackageAdder;
Logger = NullLogger<NewCommand>.Instance; Logger = NullLogger<NewCommand>.Instance;
@ -201,6 +206,10 @@ public abstract class ProjectCreationCommandBase
protected void ExtractProjectZip(ProjectBuildResult project, string outputFolder) protected void ExtractProjectZip(ProjectBuildResult project, string outputFolder)
{ {
EventBus.PublishAsync(new ProjectCreationProgressEvent {
Message = "Extracting solution to file system"
}, false);
using (var templateFileStream = new MemoryStream(project.ZipContent)) using (var templateFileStream = new MemoryStream(project.ZipContent))
{ {
using (var zipInputStream = new ZipInputStream(templateFileStream)) using (var zipInputStream = new ZipInputStream(templateFileStream))
@ -332,10 +341,14 @@ public abstract class ProjectCreationCommandBase
throw new CliUsageException("The option you provided for Database Provider is invalid!"); throw new CliUsageException("The option you provided for Database Provider is invalid!");
} }
protected virtual void RunGraphBuildForMicroserviceServiceTemplate(ProjectBuildArgs projectArgs) protected virtual async Task RunGraphBuildForMicroserviceServiceTemplate(ProjectBuildArgs projectArgs)
{ {
if (MicroserviceServiceTemplateBase.IsMicroserviceServiceTemplate(projectArgs.TemplateName)) if (MicroserviceServiceTemplateBase.IsMicroserviceServiceTemplate(projectArgs.TemplateName))
{ {
await EventBus.PublishAsync(new ProjectCreationProgressEvent {
Message = "Building the microservice solution"
}, false);
CmdHelper.RunCmd("dotnet build /graphbuild", projectArgs.OutputFolder); CmdHelper.RunCmd("dotnet build /graphbuild", projectArgs.OutputFolder);
} }
} }
@ -348,6 +361,11 @@ public abstract class ProjectCreationCommandBase
MicroserviceServiceTemplateBase.IsMicroserviceTemplate(projectArgs.TemplateName)) MicroserviceServiceTemplateBase.IsMicroserviceTemplate(projectArgs.TemplateName))
{ {
Logger.LogInformation("Installing client-side packages..."); Logger.LogInformation("Installing client-side packages...");
await EventBus.PublishAsync(new ProjectCreationProgressEvent {
Message = "Installing client-side packages"
}, false);
await InstallLibsService.InstallLibsAsync(projectArgs.OutputFolder); await InstallLibsService.InstallLibsAsync(projectArgs.OutputFolder);
} }
} }
@ -384,10 +402,14 @@ public abstract class ProjectCreationCommandBase
return; return;
} }
await EventBus.PublishAsync(new ProjectCreationProgressEvent {
Message = "Creating the initial migration"
}, false);
await InitialMigrationCreator.CreateAsync(Path.GetDirectoryName(efCoreProjectPath), isLayeredTemplate); await InitialMigrationCreator.CreateAsync(Path.GetDirectoryName(efCoreProjectPath), isLayeredTemplate);
} }
protected void ConfigurePwaSupportForAngular(ProjectBuildArgs projectArgs) protected async Task ConfigurePwaSupportForAngular(ProjectBuildArgs projectArgs)
{ {
var isAngular = projectArgs.UiFramework == UiFramework.Angular; var isAngular = projectArgs.UiFramework == UiFramework.Angular;
var isPwa = projectArgs.Pwa; var isPwa = projectArgs.Pwa;
@ -395,6 +417,7 @@ public abstract class ProjectCreationCommandBase
if (isAngular && isPwa) if (isAngular && isPwa)
{ {
Logger.LogInformation("Adding PWA Support to Angular app."); Logger.LogInformation("Adding PWA Support to Angular app.");
AngularPwaSupportAdder.AddPwaSupport(projectArgs.OutputFolder); AngularPwaSupportAdder.AddPwaSupport(projectArgs.OutputFolder);
} }
} }

14
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeApplicationIdGuidStep.cs

@ -1,14 +0,0 @@
using System;
using System.Linq;
namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps;
public class ChangeApplicationIdGuidStep: ProjectBuildPipelineStep
{
public override void Execute(ProjectBuildContext context)
{
var projectFile = context.Files.FirstOrDefault(f => f.Name.EndsWith("MyCompanyName.MyProjectName.csproj"));
projectFile?.SetContent(projectFile.Content.Replace("27317750-B571-4690-B433-B358B2480E01", Guid.NewGuid().ToString()));
}
}

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Events/ProjectCreationProgressEvent.cs

@ -0,0 +1,6 @@
namespace Volo.Abp.Cli.ProjectBuilding.Events;
public class ProjectCreationProgressEvent
{
public string Message { get; set; }
}

17
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateProjectBuilder.cs

@ -10,8 +10,10 @@ using Volo.Abp.Cli.Commands;
using Volo.Abp.Cli.Licensing; using Volo.Abp.Cli.Licensing;
using Volo.Abp.Cli.ProjectBuilding.Analyticses; using Volo.Abp.Cli.ProjectBuilding.Analyticses;
using Volo.Abp.Cli.ProjectBuilding.Building; using Volo.Abp.Cli.ProjectBuilding.Building;
using Volo.Abp.Cli.ProjectBuilding.Events;
using Volo.Abp.Cli.ProjectBuilding.Templates.App; using Volo.Abp.Cli.ProjectBuilding.Templates.App;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Local;
using Volo.Abp.Json; using Volo.Abp.Json;
namespace Volo.Abp.Cli.ProjectBuilding; namespace Volo.Abp.Cli.ProjectBuilding;
@ -26,6 +28,7 @@ public class TemplateProjectBuilder : IProjectBuilder, ITransientDependency
protected AbpCliOptions Options { get; } protected AbpCliOptions Options { get; }
protected IJsonSerializer JsonSerializer { get; } protected IJsonSerializer JsonSerializer { get; }
protected IApiKeyService ApiKeyService { get; } protected IApiKeyService ApiKeyService { get; }
protected ILocalEventBus EventBus { get; }
private readonly IConfiguration _configuration; private readonly IConfiguration _configuration;
@ -35,7 +38,8 @@ public class TemplateProjectBuilder : IProjectBuilder, ITransientDependency
IOptions<AbpCliOptions> options, IOptions<AbpCliOptions> options,
IJsonSerializer jsonSerializer, IJsonSerializer jsonSerializer,
IApiKeyService apiKeyService, IApiKeyService apiKeyService,
IConfiguration configuration) IConfiguration configuration,
ILocalEventBus eventBus)
{ {
SourceCodeStore = sourceCodeStore; SourceCodeStore = sourceCodeStore;
TemplateInfoProvider = templateInfoProvider; TemplateInfoProvider = templateInfoProvider;
@ -43,6 +47,7 @@ public class TemplateProjectBuilder : IProjectBuilder, ITransientDependency
Options = options.Value; Options = options.Value;
JsonSerializer = jsonSerializer; JsonSerializer = jsonSerializer;
ApiKeyService = apiKeyService; ApiKeyService = apiKeyService;
EventBus = eventBus;
_configuration = configuration; _configuration = configuration;
Logger = NullLogger<TemplateProjectBuilder>.Instance; Logger = NullLogger<TemplateProjectBuilder>.Instance;
@ -54,6 +59,10 @@ public class TemplateProjectBuilder : IProjectBuilder, ITransientDependency
NormalizeArgs(args, templateInfo); NormalizeArgs(args, templateInfo);
await EventBus.PublishAsync(new ProjectCreationProgressEvent {
Message = "Fetching the solution template"
}, false);
var templateFile = await SourceCodeStore.GetAsync( var templateFile = await SourceCodeStore.GetAsync(
args.TemplateName, args.TemplateName,
SourceCodeTypes.Template, SourceCodeTypes.Template,
@ -116,7 +125,11 @@ public class TemplateProjectBuilder : IProjectBuilder, ITransientDependency
{ {
appTemplateBase.HasDbMigrations = SemanticVersion.Parse(templateFile.Version) < new SemanticVersion(4, 3, 99); appTemplateBase.HasDbMigrations = SemanticVersion.Parse(templateFile.Version) < new SemanticVersion(4, 3, 99);
} }
await EventBus.PublishAsync(new ProjectCreationProgressEvent {
Message = "Preparing the solution according to preferences"
}, false);
TemplateProjectBuildPipelineBuilder.Build(context).Execute(); TemplateProjectBuildPipelineBuilder.Build(context).Execute();
if (!templateInfo.DocumentUrl.IsNullOrEmpty()) if (!templateInfo.DocumentUrl.IsNullOrEmpty())

4
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs

@ -349,6 +349,7 @@ public abstract class AppTemplateBase : TemplateInfo
else else
{ {
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.Host")); steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.Host"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.IdentityServer"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.AuthServer")); steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.AuthServer"));
steps.Add(new TemplateProjectRenameStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds", "MyCompanyName.MyProjectName.HttpApi.Host")); steps.Add(new TemplateProjectRenameStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds", "MyCompanyName.MyProjectName.HttpApi.Host"));
steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44305")); steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44305"));
@ -388,6 +389,7 @@ public abstract class AppTemplateBase : TemplateInfo
{ {
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Blazor.Server.Tiered")); steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Blazor.Server.Tiered"));
steps.Add(new TemplateProjectRenameStep("MyCompanyName.MyProjectName.Blazor.Server", "MyCompanyName.MyProjectName.Blazor")); steps.Add(new TemplateProjectRenameStep("MyCompanyName.MyProjectName.Blazor.Server", "MyCompanyName.MyProjectName.Blazor"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.IdentityServer"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.Host")); steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.Host"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.AuthServer")); steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.AuthServer"));
steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44313")); steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44313"));
@ -409,6 +411,7 @@ public abstract class AppTemplateBase : TemplateInfo
{ {
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Host")); steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Host"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.Host")); steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.Host"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.IdentityServer"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.AuthServer")); steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.AuthServer"));
steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44303")); steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44303"));
} }
@ -439,6 +442,7 @@ public abstract class AppTemplateBase : TemplateInfo
else else
{ {
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.Host")); steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.Host"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.IdentityServer"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.AuthServer")); steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.AuthServer"));
steps.Add(new TemplateProjectRenameStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds", "MyCompanyName.MyProjectName.HttpApi.Host")); steps.Add(new TemplateProjectRenameStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds", "MyCompanyName.MyProjectName.HttpApi.Host"));
steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44305")); steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44305"));

34
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Maui/MauiChangeApplicationIdGuidStep.cs

@ -0,0 +1,34 @@
using System;
using System.Linq;
using System.Xml;
using Volo.Abp.Cli.ProjectBuilding.Building;
using Volo.Abp.Cli.Utils;
namespace Volo.Abp.Cli.ProjectBuilding.Templates.Maui;
public class MauiChangeApplicationIdGuidStep: ProjectBuildPipelineStep
{
public override void Execute(ProjectBuildContext context)
{
var projectFile = context.Files.FirstOrDefault(f => f.Name.EndsWith("MyCompanyName.MyProjectName.csproj") || f.Name.EndsWith("MyCompanyName.MyProjectName.Maui.csproj"));
if (projectFile == null)
{
return;
}
using (var stream = StreamHelper.GenerateStreamFromString(projectFile.Content))
{
var doc = new XmlDocument { PreserveWhitespace = true };
doc.Load(stream);
var node = doc.SelectSingleNode("/Project/PropertyGroup/ApplicationIdGuid");
if (node != null)
{
node.InnerText = Guid.NewGuid().ToString();
}
projectFile.SetContent(doc.OuterXml);
}
}
}

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Maui/MauiTemplateBase.cs

@ -16,7 +16,7 @@ public class MauiTemplateBase: TemplateInfo
{ {
var steps = new List<ProjectBuildPipelineStep> var steps = new List<ProjectBuildPipelineStep>
{ {
new ChangeApplicationIdGuidStep() new MauiChangeApplicationIdGuidStep()
}; };
return steps; return steps;

4
framework/src/Volo.Abp.Core/Volo/Abp/AbpApplicationBase.cs

@ -223,7 +223,7 @@ public abstract class AbpApplicationBase : IAbpApplication
{ {
if (_configuredServices) if (_configuredServices)
{ {
throw new AbpInitializationException("Services have already been configured! If you call ConfigureServicesAsync method, you must have set AbpApplicationCreationOptions.SkipConfigureServices tu true before."); throw new AbpInitializationException("Services have already been configured! If you call ConfigureServicesAsync method, you must have set AbpApplicationCreationOptions.SkipConfigureServices to true before.");
} }
} }
@ -231,7 +231,7 @@ public abstract class AbpApplicationBase : IAbpApplication
public virtual void ConfigureServices() public virtual void ConfigureServices()
{ {
CheckMultipleConfigureServices(); CheckMultipleConfigureServices();
var context = new ServiceConfigurationContext(Services); var context = new ServiceConfigurationContext(Services);
Services.AddSingleton(context); Services.AddSingleton(context);

13
modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20220425082215_Initial.Designer.cs → modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20220623064459_Initial.Designer.cs

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace OpenIddict.Demo.Server.Migrations namespace OpenIddict.Demo.Server.Migrations
{ {
[DbContext(typeof(ServerDbContext))] [DbContext(typeof(ServerDbContext))]
[Migration("20220425082215_Initial")] [Migration("20220623064459_Initial")]
partial class Initial partial class Initial
{ {
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -21,7 +21,7 @@ namespace OpenIddict.Demo.Server.Migrations
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("ProductVersion", "6.0.0") .HasAnnotation("ProductVersion", "6.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 128); .HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
@ -336,7 +336,8 @@ namespace OpenIddict.Demo.Server.Migrations
.HasColumnName("ExtraProperties"); .HasColumnName("ExtraProperties");
b.Property<bool>("IsActive") b.Property<bool>("IsActive")
.HasColumnType("bit"); .HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<bool>("IsDeleted") b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -682,6 +683,9 @@ namespace OpenIddict.Demo.Server.Migrations
b.Property<string>("ClientSecret") b.Property<string>("ClientSecret")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("ClientUri")
.HasColumnType("nvarchar(max)");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
.HasMaxLength(40) .HasMaxLength(40)
@ -732,6 +736,9 @@ namespace OpenIddict.Demo.Server.Migrations
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId"); .HasColumnName("LastModifierId");
b.Property<string>("LogoUri")
.HasColumnType("nvarchar(max)");
b.Property<string>("Permissions") b.Property<string>("Permissions")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");

2
modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20220425082215_Initial.cs → modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20220623064459_Initial.cs

@ -237,6 +237,8 @@ namespace OpenIddict.Demo.Server.Migrations
RedirectUris = table.Column<string>(type: "nvarchar(max)", nullable: true), RedirectUris = table.Column<string>(type: "nvarchar(max)", nullable: true),
Requirements = table.Column<string>(type: "nvarchar(max)", nullable: true), Requirements = table.Column<string>(type: "nvarchar(max)", nullable: true),
Type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true), Type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ClientUri = table.Column<string>(type: "nvarchar(max)", nullable: true),
LogoUri = table.Column<string>(type: "nvarchar(max)", nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true), ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),

11
modules/openiddict/app/OpenIddict.Demo.Server/Migrations/ServerDbContextModelSnapshot.cs

@ -19,7 +19,7 @@ namespace OpenIddict.Demo.Server.Migrations
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("ProductVersion", "6.0.0") .HasAnnotation("ProductVersion", "6.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 128); .HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
@ -334,7 +334,8 @@ namespace OpenIddict.Demo.Server.Migrations
.HasColumnName("ExtraProperties"); .HasColumnName("ExtraProperties");
b.Property<bool>("IsActive") b.Property<bool>("IsActive")
.HasColumnType("bit"); .HasColumnType("bit")
.HasColumnName("IsActive");
b.Property<bool>("IsDeleted") b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -680,6 +681,9 @@ namespace OpenIddict.Demo.Server.Migrations
b.Property<string>("ClientSecret") b.Property<string>("ClientSecret")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("ClientUri")
.HasColumnType("nvarchar(max)");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
.HasMaxLength(40) .HasMaxLength(40)
@ -730,6 +734,9 @@ namespace OpenIddict.Demo.Server.Migrations
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId"); .HasColumnName("LastModifierId");
b.Property<string>("LogoUri")
.HasColumnType("nvarchar(max)");
b.Property<string>("Permissions") b.Property<string>("Permissions")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");

19
modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/LogoutController.cs

@ -10,21 +10,12 @@ namespace Volo.Abp.OpenIddict.Controllers;
public class LogoutController : AbpOpenIdDictControllerBase public class LogoutController : AbpOpenIdDictControllerBase
{ {
[HttpGet] [HttpGet]
public virtual Task<IActionResult> GetAsync() public virtual async Task<IActionResult> GetAsync()
{ {
return Task.FromResult<IActionResult>(View("Logout")); // Ask ASP.NET Core Identity to delete the local and external cookies created
} // when the user agent is redirected from the external identity provider
// after a successful authentication flow (e.g Google or Facebook).
[HttpPost] await SignInManager.SignOutAsync();
public virtual async Task<IActionResult> PostAsync()
{
if (await HasFormValueAsync("accept"))
{
// Ask ASP.NET Core Identity to delete the local and external cookies created
// when the user agent is redirected from the external identity provider
// after a successful authentication flow (e.g Google or Facebook).
await SignInManager.SignOutAsync();
}
// Returning a SignOutResult will ask OpenIddict to redirect the user agent // Returning a SignOutResult will ask OpenIddict to redirect the user agent
// to the post_logout_redirect_uri specified by the client application or to // to the post_logout_redirect_uri specified by the client application or to

22
modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Views/Logout/Logout.cshtml

@ -1,22 +0,0 @@
@using Microsoft.Extensions.Primitives
@using Volo.Abp.OpenIddict.Localization
@using Microsoft.AspNetCore.Mvc.Localization
@model AuthorizeViewModel
@inject IHtmlLocalizer<AbpOpenIddictResource> L
<div class="jumbotron">
<h1>@L["LogOut"]</h1>
<p class="lead text-left">@L["AreYouSureYouWantToSignOut"]</p>
<form method="post" action="~/connect/logout">
@Html.AntiForgeryToken()
@* Flow the request parameters so they can be received by the LogoutPost action: *@
@foreach (var parameter in Context.Request.HasFormContentType ? (IEnumerable<KeyValuePair<string, StringValues>>) Context.Request.Form : Context.Request.Query)
{
<input type="hidden" name="@parameter.Key" value="@parameter.Value"/>
}
<input class="btn btn-primary" name="accept" type="submit" value="@L["Accept"]"/>
<input class="btn btn-danger ms-1" name="deny" type="submit" value="@L["Deny"]"/>
</form>
</div>

6
modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/el.json

@ -10,8 +10,6 @@
"DoYouWantToGrantAccessToYourData": "Θέλετε να παραχωρήσετε στον χρήστη {0} πρόσβαση στα δεδομένα σας;", "DoYouWantToGrantAccessToYourData": "Θέλετε να παραχωρήσετε στον χρήστη {0} πρόσβαση στα δεδομένα σας;",
"ScopesRequested": "Ζητούνται πεδία εφαρμογής", "ScopesRequested": "Ζητούνται πεδία εφαρμογής",
"Accept": "Αποδοχή", "Accept": "Αποδοχή",
"Deny": "Άρνηση", "Deny": "Άρνηση"
"LogOut": "Αποσύνδεση",
"AreYouSureYouWantToSignOut": "Είστε βέβαιοι ότι θέλετε να αποσυνδεθείτε;"
} }
} }

4
modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/en.json

@ -10,8 +10,6 @@
"DoYouWantToGrantAccessToYourData": "Do you want to grant {0} access to your data?", "DoYouWantToGrantAccessToYourData": "Do you want to grant {0} access to your data?",
"ScopesRequested": "Scopes requested", "ScopesRequested": "Scopes requested",
"Accept": "Accept", "Accept": "Accept",
"Deny": "Deny", "Deny": "Deny"
"LogOut": "Log out",
"AreYouSureYouWantToSignOut": "Are you sure you want to sign out?"
} }
} }

6
modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/pt-BR.json

@ -10,8 +10,6 @@
"DoYouWantToGrantAccessToYourData": "Deseja permitir {0} acesse seus dados?", "DoYouWantToGrantAccessToYourData": "Deseja permitir {0} acesse seus dados?",
"ScopesRequested": "Escopo solicitado", "ScopesRequested": "Escopo solicitado",
"Accept": "Aceitar", "Accept": "Aceitar",
"Deny": "Negar", "Deny": "Negar"
"LogOut": "Sair",
"AreYouSureYouWantToSignOut": "Tem certeza que deseja sair?"
} }
} }

4
modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/tr.json

@ -10,8 +10,6 @@
"DoYouWantToGrantAccessToYourData": "Do you want to grant {0} access to your data?", "DoYouWantToGrantAccessToYourData": "Do you want to grant {0} access to your data?",
"ScopesRequested": "İstenen kapsamlar", "ScopesRequested": "İstenen kapsamlar",
"Accept": "Kabul etmek", "Accept": "Kabul etmek",
"Deny": "Reddetmek", "Deny": "Reddetmek"
"LogOut": "Çıkış Yap",
"AreYouSureYouWantToSignOut": "Çıkış yapmak istediğinden emin misin?"
} }
} }

4
modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hans.json

@ -10,8 +10,6 @@
"DoYouWantToGrantAccessToYourData": "是否要授予 {0} 访问你的数据的权限?", "DoYouWantToGrantAccessToYourData": "是否要授予 {0} 访问你的数据的权限?",
"ScopesRequested": "要求的Scope", "ScopesRequested": "要求的Scope",
"Accept": "同意", "Accept": "同意",
"Deny": "拒绝", "Deny": "拒绝"
"LogOut": "注销",
"AreYouSureYouWantToSignOut": "你确定要退出吗?"
} }
} }

4
modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo/Abp/OpenIddict/Localization/OpenIddict/zh-Hant.json

@ -11,8 +11,6 @@
"DoYouWantToGrantAccessToYourData": "是否要授予 {0} 訪問你的數據的權限?", "DoYouWantToGrantAccessToYourData": "是否要授予 {0} 訪問你的數據的權限?",
"ScopesRequested": "要求的Scope", "ScopesRequested": "要求的Scope",
"Accept": "接受", "Accept": "接受",
"Deny": "拒絕", "Deny": "拒絕"
"LogOut": "註銷",
"AreYouSureYouWantToSignOut": "你確定要退出嗎?"
} }
} }

Loading…
Cancel
Save