优化配置文件查询

This commit is contained in:
不做码农
2022-02-23 18:30:17 +08:00
parent 3981fa2303
commit e98bde7ad5
13 changed files with 121 additions and 24 deletions

View File

@@ -237,7 +237,7 @@ namespace ZR.Admin.WebApi.Controllers
var genTableInfo = GenTableService.GetGenTableInfo(dto.TableId);
genTableInfo.Columns = GenTableColumnService.GenTableColumns(dto.TableId);
dto.DbType = ConfigUtils.Instance.GetAppConfig(OptionsSetting.ConnBusDbType, 0);
dto.DbType = AppSettings.GetAppConfig(OptionsSetting.ConnBusDbType, 0);
dto.GenTable = genTableInfo;
dto.IsPreview = true;
//生成代码
@@ -263,7 +263,7 @@ namespace ZR.Admin.WebApi.Controllers
var genTableInfo = GenTableService.GetGenTableInfo(dto.TableId);
genTableInfo.Columns = GenTableColumnService.GenTableColumns(dto.TableId);
dto.DbType = ConfigUtils.Instance.GetAppConfig(OptionsSetting.ConnBusDbType, 0);
dto.DbType = AppSettings.GetAppConfig(OptionsSetting.ConnBusDbType, 0);
dto.GenTable = genTableInfo;
//自定义路径
if (genTableInfo.GenType == "1")

View File

@@ -57,7 +57,7 @@ namespace ZR.Admin.WebApi.Filters
HasPermi = perms.Exists(f => f.ToLower() == Permission.ToLower());
}
bool isDemoMode = ConfigUtils.Instance.GetAppConfig("DemoMode", false);
bool isDemoMode = AppSettings.GetAppConfig("DemoMode", false);
//演示公开环境屏蔽权限
string[] denyPerms = new string[] { "update", "add", "remove", "add", "edit", "delete", "import", "run", "start", "stop", "clear", "send", "export", "upload", "common" };

View File

@@ -71,8 +71,9 @@ namespace ZR.Admin.WebApi.Framework
/// <returns></returns>
public static TokenValidationParameters ValidParameters()
{
JwtSettings jwtSettings = new JwtSettings();
ConfigUtils.Instance.Bind("JwtSettings", jwtSettings);
JwtSettings jwtSettings = new();
AppSettings.Bind("JwtSettings", jwtSettings);
if (jwtSettings == null || jwtSettings.SecretKey.IsEmpty())
{
throw new Exception("JwtSettings获取失败");

View File

@@ -44,7 +44,8 @@ namespace ZR.Admin.WebApi
});
});
//<2F><><EFBFBD><EFBFBD>Error unprotecting the session cookie<69><65><EFBFBD><EFBFBD>
services.AddDataProtection().PersistKeysToFileSystem(new DirectoryInfo(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + "DataProtection"));
services.AddDataProtection()
.PersistKeysToFileSystem(new DirectoryInfo(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + "DataProtection"));
//<2F><>ͨ<EFBFBD><CDA8>֤<EFBFBD><D6A4>
services.AddHeiCaptcha();
services.AddSession();
@@ -130,12 +131,12 @@ namespace ZR.Admin.WebApi
private void InjectServices(IServiceCollection services, IConfiguration configuration)
{
services.AddAppService();
services.AddSingleton(new AppSettings(configuration));
//<2F><><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD>
services.AddTaskSchedulers();
//<2F><>ʼ<EFBFBD><CABC>db
DbExtension.AddDb(configuration);
//ע<><D7A2>REDIS <20><><EFBFBD><EFBFBD>
Task.Run(() =>
{