diff --git a/Readme.md b/Readme.md
index 44252413..61c5fe27 100644
--- a/Readme.md
+++ b/Readme.md
@@ -11,7 +11,6 @@
## 🔗 链接
- [文档地址](http://doc.cncore.club/)
-- [演示地址](http://116.205.176.173/)
- [视频教程](https://www.bilibili.com/video/BV1pt4y1E7aZ)
diff --git a/aspnet-core/Directory.Build.Volo.targets b/aspnet-core/Directory.Build.Volo.targets
index a74edab0..c51f5abe 100644
--- a/aspnet-core/Directory.Build.Volo.targets
+++ b/aspnet-core/Directory.Build.Volo.targets
@@ -1,92 +1,92 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/aspnet-core/Directory.Build.targets b/aspnet-core/Directory.Build.targets
index 2f57249c..53ef2d19 100644
--- a/aspnet-core/Directory.Build.targets
+++ b/aspnet-core/Directory.Build.targets
@@ -6,7 +6,7 @@
latest
1.0.0
- $(NoWarn);CS1591;CS0436
+ $(NoWarn);CS1591;CS0436;NU1504
app
true
WangJunZzz
@@ -32,24 +32,22 @@
-
-
-
+
+
+
-
-
-
+
-
-
-
-
-
-
+
+
+
+
+
+
@@ -66,8 +64,9 @@
-
-
+
+
+
@@ -76,16 +75,13 @@
-
-
-
+
+
-
-
-
+
diff --git a/aspnet-core/frameworks/Extensions/src/Lion.AbpPro.Extension/Customs/Dtos/WrapResultAttribute.cs b/aspnet-core/frameworks/Extensions/src/Lion.AbpPro.Extension/Customs/Dtos/WrapResultAttribute.cs
new file mode 100644
index 00000000..2cbd5027
--- /dev/null
+++ b/aspnet-core/frameworks/Extensions/src/Lion.AbpPro.Extension/Customs/Dtos/WrapResultAttribute.cs
@@ -0,0 +1,6 @@
+namespace Lion.AbpPro.Extension.Customs.Dtos
+{
+ public class WrapResultAttribute : Attribute
+ {
+ }
+}
\ No newline at end of file
diff --git a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Users/UserAppService.cs b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Users/UserAppService.cs
index e1bc4e76..b9e1a2c5 100644
--- a/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Users/UserAppService.cs
+++ b/aspnet-core/modules/BasicManagement/src/Lion.AbpPro.BasicManagement.Application/Users/UserAppService.cs
@@ -1,9 +1,11 @@
+using Lion.AbpPro.BasicManagement.Localization;
using Lion.AbpPro.BasicManagement.Users.Dtos;
using Magicodes.ExporterAndImporter.Excel;
using Magicodes.ExporterAndImporter.Excel.AspNetCore;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Account;
+using Volo.Abp.Identity.Localization;
namespace Lion.AbpPro.BasicManagement.Users
{
@@ -15,18 +17,22 @@ namespace Lion.AbpPro.BasicManagement.Users
private readonly IIdentityUserRepository _identityUserRepository;
private readonly IExcelExporter _excelExporter;
private readonly IOptions _options;
+ private readonly IStringLocalizer _localizer;
+
public UserAppService(
IIdentityUserAppService identityUserAppService,
IdentityUserManager userManager,
IIdentityUserRepository userRepository,
IExcelExporter excelExporter,
- IOptions options)
+ IOptions options,
+ IStringLocalizer localizer)
{
_identityUserAppService = identityUserAppService;
_userManager = userManager;
_identityUserRepository = userRepository;
_excelExporter = excelExporter;
_options = options;
+ _localizer = localizer;
}
///
@@ -117,8 +123,6 @@ namespace Lion.AbpPro.BasicManagement.Users
///
/// 修改密码
///
- ///
- ///
public async Task ChangePasswordAsync(ChangePasswordInput input)
{
await _options.SetAsync();
@@ -134,7 +138,7 @@ namespace Lion.AbpPro.BasicManagement.Users
}
return !result.Succeeded
- ? throw new UserFriendlyException(result?.Errors?.FirstOrDefault()?.Description)
+ ? throw new BusinessException("Volo.Abp.Identity:" + result?.Errors?.FirstOrDefault()?.Code)
: result.Succeeded;
}
@@ -151,4 +155,4 @@ namespace Lion.AbpPro.BasicManagement.Users
await _userManager.UpdateAsync(identityUser);
}
}
-}
+}
\ No newline at end of file
diff --git a/aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Application/DataDictionaries/DataDictionaryAppService.cs b/aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Application/DataDictionaries/DataDictionaryAppService.cs
index a99f07b9..d523a0e4 100644
--- a/aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Application/DataDictionaries/DataDictionaryAppService.cs
+++ b/aspnet-core/modules/DataDictionaryManagement/src/Lion.AbpPro.DataDictionaryManagement.Application/DataDictionaries/DataDictionaryAppService.cs
@@ -56,7 +56,10 @@ namespace Lion.AbpPro.DataDictionaryManagement.DataDictionaries
var details = entity.Details
.WhereIf(input.Filter.IsNotNullOrWhiteSpace(), e => (e.Code.Contains(input.Filter) || e.DisplayText.Contains(input.Filter)))
.OrderBy(e => e.Order)
- .Take(input.PageSize).Skip(input.SkipCount).ToList();
+ .ThenBy(e=> e.CreationTime)
+ .Skip(input.SkipCount)
+ .Take(input.PageSize)
+ .ToList();
if (details.Count == 0)
{
return new PagedResultDto();
diff --git a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs
index 8904e1a2..33526c96 100644
--- a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs
+++ b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs
@@ -32,9 +32,8 @@ namespace Lion.AbpPro
ConfigureCache(context);
ConfigureSwaggerServices(context);
ConfigureJwtAuthentication(context, configuration);
- ConfigureHangfireMysql(context);
+ ConfigureHangfire(context);
ConfigureMiniProfiler(context);
- ConfigureAbpExceptions(context);
ConfigureIdentity(context);
ConfigureCap(context);
ConfigureAuditLog(context);
@@ -84,35 +83,14 @@ namespace Lion.AbpPro
}
}
- ///
- /// 异常处理
- ///
- ///
- private void ConfigureAbpExceptions(ServiceConfigurationContext context)
- {
- context.Services.AddMvc(options => { options.Filters.Add(typeof(ResultExceptionFilter)); });
- }
-
-
- private void ConfigureHangfireMysql(ServiceConfigurationContext context)
+ private void ConfigureHangfire(ServiceConfigurationContext context)
{
Configure(options => { options.IsJobExecutionEnabled = true; });
context.Services.AddHangfireServer();
context.Services.AddHangfire(config =>
{
- config.UseStorage(new MySqlStorage(
- context.Services.GetConfiguration().GetConnectionString("Default"),
- new MySqlStorageOptions()
- {
- //CommandBatchMaxTimeout = TimeSpan.FromMinutes(5),
- //SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5),
- //QueuePollInterval = TimeSpan.Zero,
- //UseRecommendedIsolationLevel = true,
- //DisableGlobalLocks = true
- JobExpirationCheckInterval = TimeSpan.FromMinutes(30),
- TablesPrefix = "Hangfire_"
- }));
+ config.UseRedisStorage(ConnectionMultiplexer.Connect(context.Services.GetConfiguration().GetConnectionString("Hangfire")));
var delaysInSeconds = new[] { 10, 60, 60 * 3 }; // 重试时间间隔
const int Attempts = 3; // 重试次数
config.UseFilter(new AutomaticRetryAttribute() { Attempts = Attempts, DelaysInSeconds = delaysInSeconds });
@@ -198,7 +176,6 @@ namespace Lion.AbpPro
});
}
-
///
/// Redis缓存
@@ -323,7 +300,7 @@ namespace Lion.AbpPro
});
}
}
-
+
///
/// 审计日志
///
diff --git a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Extensions/MVC/Filters/ResultExceptionFilter.cs b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Extensions/MVC/Filters/ResultExceptionFilter.cs
deleted file mode 100644
index d3f220b8..00000000
--- a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Extensions/MVC/Filters/ResultExceptionFilter.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-namespace Lion.AbpPro.Extensions.MVC.Filters
-{
- public sealed class ResultExceptionFilter : IAsyncExceptionFilter, ITransientDependency
- {
- public async Task OnExceptionAsync(ExceptionContext context)
- {
- if (!ShouldHandleException(context))
- {
- return;
- }
-
- await HandleAndWrapException(context);
- }
-
- private bool ShouldHandleException(ExceptionContext context)
- {
- if (context.ActionDescriptor.AsControllerActionDescriptor().ControllerTypeInfo.GetCustomAttributes(typeof(DontWrapResultAttribute), true).Any())
- {
- return true;
- }
-
- if (context.ActionDescriptor.GetMethodInfo().GetCustomAttributes(typeof(DontWrapResultAttribute), true).Any())
- {
- return true;
- }
-
- return false;
- }
-
- private async Task HandleAndWrapException(ExceptionContext context)
- {
- var exceptionHandlingOptions = context.GetRequiredService>().Value;
- var exceptionToErrorInfoConverter = context.GetRequiredService();
- var remoteServiceErrorInfo = exceptionToErrorInfoConverter.Convert(context.Exception, options =>
- {
- options.SendExceptionsDetailsToClients = exceptionHandlingOptions.SendExceptionsDetailsToClients;
- options.SendStackTraceToClients = exceptionHandlingOptions.SendStackTraceToClients;
- });
-
- var logLevel = context.Exception.GetLogLevel();
-
- var remoteServiceErrorInfoBuilder = new StringBuilder();
- remoteServiceErrorInfoBuilder.AppendLine($"---------- {nameof(RemoteServiceErrorInfo)} ----------");
- remoteServiceErrorInfoBuilder.AppendLine(context.GetRequiredService().Serialize(remoteServiceErrorInfo, indented: true));
-
- var logger = context.GetService>(NullLogger.Instance);
-
- logger.LogWithLevel(logLevel, remoteServiceErrorInfoBuilder.ToString());
-
- logger.LogException(context.Exception, logLevel);
-
- await context.GetRequiredService().NotifyAsync(new ExceptionNotificationContext(context.Exception));
- context.HttpContext.Response.StatusCode = 200;
- var result = SimplifyMessage(context);
- context.Result = new ObjectResult(result);
- context.Exception = null; //Handled!
- }
-
- private WrapResult