feat: 完成配置模块
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System.Net.Http;
|
using System.Diagnostics;
|
||||||
|
using System.Net.Http;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Volo.Abp.DependencyInjection;
|
using Volo.Abp.DependencyInjection;
|
||||||
@@ -8,11 +9,13 @@ using static System.Net.WebRequestMethods;
|
|||||||
|
|
||||||
namespace Yi.Framework.AspNetCore.Microsoft.AspNetCore.Middlewares
|
namespace Yi.Framework.AspNetCore.Microsoft.AspNetCore.Middlewares
|
||||||
{
|
{
|
||||||
|
[DebuggerStepThrough]
|
||||||
public class ApiInfoMiddleware : IMiddleware, ITransientDependency
|
public class ApiInfoMiddleware : IMiddleware, ITransientDependency
|
||||||
{
|
{
|
||||||
|
|
||||||
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
|
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
|
||||||
{
|
{
|
||||||
context.Response.OnStarting(() =>
|
context.Response.OnStarting([DebuggerStepThrough] () =>
|
||||||
{
|
{
|
||||||
if (context.Response.StatusCode == StatusCodes.Status200OK
|
if (context.Response.StatusCode == StatusCodes.Status200OK
|
||||||
&& context.Response.Headers["Content-Type"].ToString() == "application/vnd.ms-excel")
|
&& context.Response.Headers["Content-Type"].ToString() == "application/vnd.ms-excel")
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -14,6 +15,7 @@ using Yi.Framework.Rbac.Domain.Shared.Consts;
|
|||||||
|
|
||||||
namespace Yi.Framework.Rbac.Domain.Authorization
|
namespace Yi.Framework.Rbac.Domain.Authorization
|
||||||
{
|
{
|
||||||
|
[DebuggerStepThrough]
|
||||||
public class RefreshTokenMiddleware : IMiddleware, ITransientDependency
|
public class RefreshTokenMiddleware : IMiddleware, ITransientDependency
|
||||||
{
|
{
|
||||||
private AccountManager _accountManager;
|
private AccountManager _accountManager;
|
||||||
|
|||||||
@@ -2,13 +2,16 @@
|
|||||||
using Volo.Abp.Modularity;
|
using Volo.Abp.Modularity;
|
||||||
using Volo.Abp.SettingManagement;
|
using Volo.Abp.SettingManagement;
|
||||||
using Volo.Abp.Timing;
|
using Volo.Abp.Timing;
|
||||||
|
using Yi.Framework.SettingManagement.Domain;
|
||||||
|
|
||||||
namespace Yi.Framework.SettingManagement.Application;
|
namespace Yi.Framework.SettingManagement.Application;
|
||||||
|
|
||||||
[DependsOn(
|
[DependsOn(
|
||||||
typeof(AbpDddApplicationModule),
|
typeof(AbpDddApplicationModule),
|
||||||
typeof(AbpSettingManagementApplicationContractsModule),
|
typeof(AbpSettingManagementApplicationContractsModule),
|
||||||
|
typeof(YiFrameworkSettingManagementDomainModule),
|
||||||
typeof(AbpTimingModule)
|
typeof(AbpTimingModule)
|
||||||
|
|
||||||
)]
|
)]
|
||||||
public class YiFrameworkSettingManagementApplicationModule : AbpModule
|
public class YiFrameworkSettingManagementApplicationModule : AbpModule
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Mapster;
|
using System.Xml.Linq;
|
||||||
|
using Mapster;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.RateLimiting;
|
using Microsoft.AspNetCore.RateLimiting;
|
||||||
using Volo.Abp.Application.Services;
|
using Volo.Abp.Application.Services;
|
||||||
@@ -155,7 +156,9 @@ namespace Yi.Abp.Application.Services
|
|||||||
var enableOrNull2 = await _settingManager.GetOrNullGlobalAsync("DDD");
|
var enableOrNull2 = await _settingManager.GetOrNullGlobalAsync("DDD");
|
||||||
|
|
||||||
//当然,他的独特地方,是支持来自多个模块,例如配置文件?
|
//当然,他的独特地方,是支持来自多个模块,例如配置文件?
|
||||||
var result= await _settingManager.GetOrNullConfigurationAsync("Test");
|
var result = await _settingManager.GetOrNullConfigurationAsync("Test");
|
||||||
|
|
||||||
|
|
||||||
return result ?? string.Empty;
|
return result ?? string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Yi.Abp.Domain.Shared.Settings
|
|||||||
{
|
{
|
||||||
context.Add(
|
context.Add(
|
||||||
new SettingDefinition("DDD","127.0.0.1"),
|
new SettingDefinition("DDD","127.0.0.1"),
|
||||||
new SettingDefinition("TTT", "127.0.0.1")
|
new SettingDefinition("Test", null)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
"Settings": {
|
"Settings": {
|
||||||
"Test": "hello"
|
"Test": "hello"
|
||||||
},
|
},
|
||||||
|
|
||||||
//数据库类型列表
|
//数据库类型列表
|
||||||
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],
|
"DbList": [ "Sqlite", "Mysql", "Sqlserver", "Oracle" ],
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user