diff --git a/aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Volo/Abp/DefaultHttpExceptionStatusCodeFinder.cs b/aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Volo/Abp/DefaultHttpExceptionStatusCodeFinder.cs
new file mode 100644
index 00000000..d1fef81f
--- /dev/null
+++ b/aspnet-core/frameworks/src/Lion.AbpPro.AspNetCore/Volo/Abp/DefaultHttpExceptionStatusCodeFinder.cs
@@ -0,0 +1,63 @@
+namespace Volo.Abp;
+
+///
+/// 修改Abp 返回状态码
+/// 原因: 抛出BusinessException异常 不应该抛403异常
+///
+public class DefaultHttpExceptionStatusCodeFinder : IHttpExceptionStatusCodeFinder, ITransientDependency
+{
+ protected AbpExceptionHttpStatusCodeOptions Options { get; }
+
+ public DefaultHttpExceptionStatusCodeFinder(
+ IOptions options)
+ {
+ Options = options.Value;
+ }
+
+ public HttpStatusCode GetStatusCode(HttpContext httpContext, Exception exception)
+ {
+ if (exception is IHasHttpStatusCode exceptionWithHttpStatusCode &&
+ exceptionWithHttpStatusCode.HttpStatusCode > 0)
+ {
+ return (HttpStatusCode)exceptionWithHttpStatusCode.HttpStatusCode;
+ }
+
+ if (exception is IHasErrorCode exceptionWithErrorCode &&
+ !exceptionWithErrorCode.Code.IsNullOrWhiteSpace())
+ {
+ if (Options.ErrorCodeToHttpStatusCodeMappings.TryGetValue(exceptionWithErrorCode.Code, out var status))
+ {
+ return status;
+ }
+ }
+
+ if (exception is AbpAuthorizationException)
+ {
+ return HttpStatusCode.Forbidden;
+ }
+
+ //TODO: Handle SecurityException..?
+
+ if (exception is AbpValidationException)
+ {
+ return HttpStatusCode.BadRequest;
+ }
+
+ if (exception is EntityNotFoundException)
+ {
+ return HttpStatusCode.NotFound;
+ }
+
+ if (exception is NotImplementedException)
+ {
+ return HttpStatusCode.NotImplemented;
+ }
+
+ if (exception is IBusinessException)
+ {
+ return HttpStatusCode.InternalServerError;
+ }
+
+ return HttpStatusCode.InternalServerError;
+ }
+}
\ No newline at end of file
diff --git a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json
index 656874b1..7ffad74a 100644
--- a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json
+++ b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json
@@ -44,7 +44,7 @@
"SelfUrl": "http://localhost:44315",
},
"ConnectionStrings": {
- "Default": "Data Source=localhost;Port=3306;Database=LionAbpProDemo9;uid=root;pwd=f616b8803ac7a9a0;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true"
+ "Default": "Data Source=localhost;Port=3306;Database=LionAbpProDemo9;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true"
},
"Hangfire": {
"Redis": {
@@ -53,7 +53,7 @@
}
},
"Redis": {
- "Configuration": "localhost:6379,password=75He82bB5jFA84XZ1,defaultdatabase=2"
+ "Configuration": "localhost:6379,password=1q2w3E*,defaultdatabase=2"
},
"Jwt": {
"Audience": "Lion.AbpPro",