😎1、增加是否开启定时任务配置 2、整理配置文件

This commit is contained in:
zuohuaijun 2024-09-13 15:48:28 +08:00
parent ed32d75357
commit 3a9ce81b52
14 changed files with 63 additions and 53 deletions

View File

@ -1,10 +1,8 @@
{ {
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json", "$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
"Urls": "http://*:5005", // "Urls": "http://*:5005", //
// "https_port": 44325, "AllowedHosts": "*", //
"AllowedHosts": "*",
"AppSettings": { "AppSettings": {
"InjectSpecificationDocument": true, // Swagger "InjectSpecificationDocument": true, // Swagger
@ -30,23 +28,29 @@
"DateTimeFormatCulture": "zh-CN" // "DateTimeFormatCulture": "zh-CN" //
}, },
"CorsAccessorSettings": { "CorsAccessorSettings": {
//"PolicyName": "App.Cors.Policy", //"PolicyName": "App.Cors.Policy", //
//"WithOrigins": [ "http://localhost:5005", "https://gitee.com" ], //"WithOrigins": [ "http://localhost:5005", "https://gitee.com" ], //
"WithExposedHeaders": [ "Content-Disposition", "X-Pagination", "access-token", "x-access-token", "Access-Control-Expose-Headersx-access-token" ], // axios "WithExposedHeaders": [ "Content-Disposition", "X-Pagination", "access-token", "x-access-token", "Access-Control-Expose-Headersx-access-token" ], // axios
"SignalRSupport": true // SignalR "SignalRSupport": true // SignalR
}, },
// /
"ScheduleJob": {
"Enabled": true //
},
// Id
"SnowId": { "SnowId": {
"WorkerId": 1, // "WorkerId": 1, // Id
"WorkerIdBitLength": 6, // 6 [1, 19] "WorkerIdBitLength": 6, // 6 [1, 19]
"SeqBitLength": 6, // 6 [3, 21]4Id "SeqBitLength": 6, // 6 [3, 21]4Id
"WorkerPrefix": "adminnet_" // "WorkerPrefix": "adminnet_" //
}, },
//
"Cryptogram": { "Cryptogram": {
"StrongPassword": false, // "StrongPassword": false, //
"PasswordStrengthValidation": "(?=^.{6,16}$)(?=.*\\d)(?=.*\\W+)(?=.*[A-Z])(?=.*[a-z])(?!.*\\n).*$", // 6-16 "PasswordStrengthValidation": "(?=^.{6,16}$)(?=.*\\d)(?=.*\\W+)(?=.*[A-Z])(?=.*[a-z])(?!.*\\n).*$", // 6-16
"PasswordStrengthValidationMsg": "密码必须包含大小写字母、数字和特殊字符的组合长度在6-16之间", // "PasswordStrengthValidationMsg": "密码必须包含大小写字母、数字和特殊字符的组合长度在6-16之间", //
"CryptoType": "SM2", // MD5SM2SM4 "CryptoType": "SM2", // MD5SM2SM4
// (http://localhost:5005/api/sysCommon/smKeyPair)VITE_SM_PUBLIC_KEY // (http://localhost:5005/api/sysCommon/smKeyPair)VITE_SM_PUBLIC_KEY
"PublicKey": "04851D329AA3E38C2E7670AFE70E6E70E92F8769CA27C8766B12209A0FFBA4493B603EF7A0B9B1E16F0E8930C0406EA0B179B68DF28E25334BDEC4AE76D907E9E9", // "PublicKey": "04851D329AA3E38C2E7670AFE70E6E70E92F8769CA27C8766B12209A0FFBA4493B603EF7A0B9B1E16F0E8930C0406EA0B179B68DF28E25334BDEC4AE76D907E9E9", //
"PrivateKey": "3A61D1D30C6302DABFF36201D936D0143EEF0C850AF28C5CA6D5C045AF8C5C8A" // "PrivateKey": "3A61D1D30C6302DABFF36201D936D0143EEF0C850AF28C5CA6D5C045AF8C5C8A" //
} }

View File

@ -1,6 +1,7 @@
{ {
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json", "$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
//
"Cache": { "Cache": {
"Prefix": "adminnet_", // "Prefix": "adminnet_", //
"CacheType": "Memory", // MemoryRedis "CacheType": "Memory", // MemoryRedis
@ -11,7 +12,8 @@
"AutoDetect": false // Redis使false "AutoDetect": false // Redis使false
} }
}, },
"Cluster": { // //
"Cluster": {
"Enabled": false, // Redis "Enabled": false, // Redis
"ServerId": "adminnet", // "ServerId": "adminnet", //
"ServerIp": "", // IP "ServerIp": "", // IP

View File

@ -3,7 +3,7 @@
// - // -
"CodeGen": { "CodeGen": {
"EntityAssemblyNames": [ "Admin.NET.Core", "Admin.NET.Application" ], // "EntityAssemblyNames": [ "Admin.NET.Core", "Admin.NET.Application" ], //
"BaseEntityNames": [ "EntityTenantId", "EntityTenant", "EntityTenantBaseData", "EntityBaseData", "EntityBase", "EntityBaseId" ], // "BaseEntityNames": [ "EntityTenantId", "EntityTenant", "EntityTenantBaseData", "EntityBaseData", "EntityBase", "EntityBaseId" ], //
"EntityBaseColumn": { "EntityBaseColumn": {
"EntityTenantId": [ "Id", "TenantId" ], "EntityTenantId": [ "Id", "TenantId" ],
@ -12,9 +12,8 @@
"EntityBaseData": [ "Id", "CreateTime", "UpdateTime", "CreateUserId", "UpdateUserId", "CreateUserName", "UpdateUserName", "IsDelete", "CreateOrgId", "CreateOrgName" ], "EntityBaseData": [ "Id", "CreateTime", "UpdateTime", "CreateUserId", "UpdateUserId", "CreateUserName", "UpdateUserName", "IsDelete", "CreateOrgId", "CreateOrgName" ],
"EntityBase": [ "Id", "CreateTime", "UpdateTime", "CreateUserId", "UpdateUserId", "CreateUserName", "UpdateUserName", "IsDelete" ], "EntityBase": [ "Id", "CreateTime", "UpdateTime", "CreateUserId", "UpdateUserId", "CreateUserName", "UpdateUserName", "IsDelete" ],
"EntityBaseId": [ "Id" ] "EntityBaseId": [ "Id" ]
//"BaseId": [ "Id" ]
}, },
"FrontRootPath": "Web", // "FrontRootPath": "Web", //
"BackendApplicationNamespaces": [ "Admin.NET.Application", "Admin.NET.Application2" ] // "BackendApplicationNamespaces": [ "Admin.NET.Application", "Admin.NET.Application2" ] //
} }
} }

View File

@ -9,11 +9,11 @@
{ {
//"ConfigId": "1300000000001", // - //"ConfigId": "1300000000001", // -
"DbType": "Sqlite", // MySqlSqlServerSqliteOraclePostgreSQLDmKdbndpOscarMySqlConnectorAccessOpenGaussQuestDBHGClickHouseGBaseOdbcCustom "DbType": "Sqlite", // MySqlSqlServerSqliteOraclePostgreSQLDmKdbndpOscarMySqlConnectorAccessOpenGaussQuestDBHGClickHouseGBaseOdbcCustom
"ConnectionString": "DataSource=./Admin.NET.db", // Sqlite "ConnectionString": "DataSource=./Admin.NET.db", // Sqlite
//"ConnectionString": "PORT=5432;DATABASE=xxx;HOST=localhost;PASSWORD=xxx;USER ID=xxx", // PostgreSQL //"ConnectionString": "PORT=5432;DATABASE=xxx;HOST=localhost;PASSWORD=xxx;USER ID=xxx", // PostgreSQL
//"ConnectionString": "Server=localhost;Database=xxx;Uid=xxx;Pwd=xxx;SslMode=None;", // MySql ", //"ConnectionString": "Server=localhost;Database=xxx;Uid=xxx;Pwd=xxx;SslMode=None;", // MySql,
//"ConnectionString": "User Id=xxx; Password=xxx; Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)))", // Oracle //"ConnectionString": "User Id=xxx; Password=xxx; Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)))", // Oracle
//"ConnectionString": "Server=localhost;Database=xxx;User Id=xxx;Password=xxx;", // SqlServer //"ConnectionString": "Server=localhost;Database=xxx;User Id=xxx;Password=xxx;", // SqlServer
//"SlaveConnectionConfigs": [ // / //"SlaveConnectionConfigs": [ // /
// { // {
@ -26,17 +26,17 @@
// } // }
//], //],
"DbSettings": { "DbSettings": {
"EnableInitDb": true, // "EnableInitDb": true, //
"EnableDiffLog": false, // "EnableDiffLog": false, //
"EnableUnderLine": false // 线 "EnableUnderLine": false // 线
}, },
"TableSettings": { "TableSettings": {
"EnableInitTable": true, // "EnableInitTable": true, //
"EnableIncreTable": false // -[IncreTable] "EnableIncreTable": false // [IncreTable]
}, },
"SeedSettings": { "SeedSettings": {
"EnableInitSeed": true, // "EnableInitSeed": true, //
"EnableIncreSeed": false // -[IncreSeed] "EnableIncreSeed": false // [IncreSeed]
} }
} }
//// ////
@ -45,17 +45,17 @@
// "DbType": "Sqlite", // "DbType": "Sqlite",
// "ConnectionString": "DataSource=./Admin.NET.Log.db", // // "ConnectionString": "DataSource=./Admin.NET.Log.db", //
// "DbSettings": { // "DbSettings": {
// "EnableInitDb": true, // // "EnableInitDb": true, //
// "EnableDiffLog": false, // // "EnableDiffLog": false, //
// "EnableUnderLine": false // 线 // "EnableUnderLine": false // 线
// }, // },
// "TableSettings": { // "TableSettings": {
// "EnableInitTable": true, // // "EnableInitTable": true, //
// "EnableIncreTable": false // -[IncreTable] // "EnableIncreTable": false // [IncreTable]
// }, // },
// "SeedSettings": { // "SeedSettings": {
// "EnableInitSeed": false, // // "EnableInitSeed": false, //
// "EnableIncreSeed": false // -[IncreSeed] // "EnableIncreSeed": false // [IncreSeed]
// } // }
//}, //},
//// ////
@ -64,17 +64,17 @@
// "DbType": "Sqlite", // // "DbType": "Sqlite", //
// "ConnectionString": "DataSource=./Admin.NET.Test.db", // // "ConnectionString": "DataSource=./Admin.NET.Test.db", //
// "DbSettings": { // "DbSettings": {
// "EnableInitDb": true, // // "EnableInitDb": true, //
// "EnableDiffLog": false, // // "EnableDiffLog": false, //
// "EnableUnderLine": false // 线 // "EnableUnderLine": false // 线
// }, // },
// "TableSettings": { // "TableSettings": {
// "EnableInitTable": true, // // "EnableInitTable": true, //
// "EnableIncreTable": false // -[IncreTable] // "EnableIncreTable": false // [IncreTable]
// }, // },
// "SeedSettings": { // "SeedSettings": {
// "EnableInitSeed": true, // // "EnableInitSeed": true, //
// "EnableIncreSeed": false // -[IncreSeed] // "EnableIncreSeed": false // [IncreSeed]
// } // }
//} //}
] ]

View File

@ -1,6 +1,7 @@
{ {
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json", "$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
//
"Email": { "Email": {
"Host": "smtp.163.com", // "Host": "smtp.163.com", //
"Port": 465, // 46599425 "Port": 465, // 46599425

View File

@ -1,8 +1,8 @@
{ {
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json", "$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
// //
"Enum": { "Enum": {
"EntityAssemblyNames": [ "Admin." ] "EntityAssemblyNames": [ "Admin." ] //
} }
} }

View File

@ -59,7 +59,7 @@
"IpRateLimitPolicies": { "IpRateLimitPolicies": {
"IpRules": [ "IpRules": [
{ {
"Ip": "0.0.0.0", // IP"::1/10" "Ip": "0.0.0.0", // IP"::1/10"
"Rules": [ "Rules": [
{ {
"Endpoint": "*", "Endpoint": "*",

View File

@ -18,7 +18,7 @@
}, },
"Database": { "Database": {
"Enabled": true, // "Enabled": true, //
"MinimumLevel": "Information" "MinimumLevel": "Information" //
}, },
"ElasticSearch": { "ElasticSearch": {
"Enabled": false, // ES "Enabled": false, // ES

View File

@ -1,7 +1,9 @@
{ {
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json", "$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
//
"SMS": { "SMS": {
//
"Aliyun": { "Aliyun": {
"AccessKeyId": "", "AccessKeyId": "",
"AccessKeySecret": "", "AccessKeySecret": "",
@ -20,6 +22,7 @@
} }
] ]
}, },
//
"Tencentyun": { "Tencentyun": {
"SdkAppId": "", "SdkAppId": "",
"AccessKeyId": "", "AccessKeyId": "",

View File

@ -8,7 +8,7 @@
"EnableMd5": false // MDF5- "EnableMd5": false // MDF5-
}, },
"OSSProvider": { "OSSProvider": {
"IsEnable": false, "Enabled": false,
"Provider": "Minio", // OSS Invalid/Minio/Aliyun/QCloud/Qiniu/HuaweiCloud "Provider": "Minio", // OSS Invalid/Minio/Aliyun/QCloud/Qiniu/HuaweiCloud
"Endpoint": "xxx.xxx.xxx.xxx:8090", // /APIOSSAppId "Endpoint": "xxx.xxx.xxx.xxx:8090", // /APIOSSAppId
"Region": "xxx.xxx.xxx.xxx", // "Region": "xxx.xxx.xxx.xxx", //
@ -20,7 +20,7 @@
"CustomHost": "" // HostHost使Endpoint "CustomHost": "" // HostHost使Endpoint
}, },
"SSHProvider": { "SSHProvider": {
"IsEnable": false, "Enabled": false,
"Host": "127.0.0.1", "Host": "127.0.0.1",
"Port": 8222, "Port": 8222,
"Username": "sshuser", "Username": "sshuser",

View File

@ -41,7 +41,7 @@
<PackageReference Include="SqlSugarCore" Version="5.1.4.167" /> <PackageReference Include="SqlSugarCore" Version="5.1.4.167" />
<PackageReference Include="SSH.NET" Version="2024.1.0" /> <PackageReference Include="SSH.NET" Version="2024.1.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.5" /> <PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.5" />
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1085" /> <PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1087" />
<PackageReference Include="UAParser" Version="3.1.47" /> <PackageReference Include="UAParser" Version="3.1.47" />
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" /> <PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
</ItemGroup> </ItemGroup>

View File

@ -43,7 +43,7 @@ public sealed class OSSProviderOptions : OSSOptions, IConfigurableOptions
/// <summary> /// <summary>
/// 是否启用OSS存储 /// 是否启用OSS存储
/// </summary> /// </summary>
public bool IsEnable { get; set; } public bool Enabled { get; set; }
/// <summary> /// <summary>
/// 自定义桶名称 不能直接使用Provider来替代桶名称 /// 自定义桶名称 不能直接使用Provider来替代桶名称

View File

@ -32,7 +32,7 @@ public class SysFileService : IDynamicApiController, ITransient
_sysFileRep = sysFileRep; _sysFileRep = sysFileRep;
_OSSProviderOptions = oSSProviderOptions.Value; _OSSProviderOptions = oSSProviderOptions.Value;
_uploadOptions = uploadOptions.Value; _uploadOptions = uploadOptions.Value;
if (_OSSProviderOptions.IsEnable) if (_OSSProviderOptions.Enabled)
_OSSService = ossServiceFactory.Create(Enum.GetName(_OSSProviderOptions.Provider)); _OSSService = ossServiceFactory.Create(Enum.GetName(_OSSProviderOptions.Provider));
} }
@ -120,12 +120,12 @@ public class SysFileService : IDynamicApiController, ITransient
var fileName = HttpUtility.UrlEncode(file.FileName, Encoding.GetEncoding("UTF-8")); var fileName = HttpUtility.UrlEncode(file.FileName, Encoding.GetEncoding("UTF-8"));
var filePath = Path.Combine(file.FilePath, file.Id.ToString() + file.Suffix); var filePath = Path.Combine(file.FilePath, file.Id.ToString() + file.Suffix);
if (_OSSProviderOptions.IsEnable) if (_OSSProviderOptions.Enabled)
{ {
var stream = await (await _OSSService.PresignedGetObjectAsync(file.BucketName.ToString(), filePath, 5)).GetAsStreamAsync(); var stream = await (await _OSSService.PresignedGetObjectAsync(file.BucketName.ToString(), filePath, 5)).GetAsStreamAsync();
return new FileStreamResult(stream.Stream, "application/octet-stream") { FileDownloadName = fileName + file.Suffix }; return new FileStreamResult(stream.Stream, "application/octet-stream") { FileDownloadName = fileName + file.Suffix };
} }
else if (App.Configuration["SSHProvider:IsEnable"].ToBoolean()) else if (App.Configuration["SSHProvider:Enabled"].ToBoolean())
{ {
using (SSHHelper helper = new SSHHelper(App.Configuration["SSHProvider:Host"], using (SSHHelper helper = new SSHHelper(App.Configuration["SSHProvider:Host"],
App.Configuration["SSHProvider:Port"].ToInt(), App.Configuration["SSHProvider:Username"], App.Configuration["SSHProvider:Password"])) App.Configuration["SSHProvider:Port"].ToInt(), App.Configuration["SSHProvider:Username"], App.Configuration["SSHProvider:Password"]))
@ -152,12 +152,12 @@ public class SysFileService : IDynamicApiController, ITransient
//var fileName = HttpUtility.UrlEncode(file.FileName, Encoding.GetEncoding("UTF-8")); //var fileName = HttpUtility.UrlEncode(file.FileName, Encoding.GetEncoding("UTF-8"));
var filePath = Path.Combine(file.FilePath, file.Id.ToString() + file.Suffix); var filePath = Path.Combine(file.FilePath, file.Id.ToString() + file.Suffix);
if (_OSSProviderOptions.IsEnable) if (_OSSProviderOptions.Enabled)
{ {
var stream = await (await _OSSService.PresignedGetObjectAsync(file.BucketName.ToString(), filePath, 5)).GetAsStreamAsync(); var stream = await (await _OSSService.PresignedGetObjectAsync(file.BucketName.ToString(), filePath, 5)).GetAsStreamAsync();
return new FileStreamResult(stream.Stream, "application/octet-stream"); return new FileStreamResult(stream.Stream, "application/octet-stream");
} }
else if (App.Configuration["SSHProvider:IsEnable"].ToBoolean()) else if (App.Configuration["SSHProvider:Enabled"].ToBoolean())
{ {
using (SSHHelper helper = new SSHHelper(App.Configuration["SSHProvider:Host"], using (SSHHelper helper = new SSHHelper(App.Configuration["SSHProvider:Host"],
App.Configuration["SSHProvider:Port"].ToInt(), App.Configuration["SSHProvider:Username"], App.Configuration["SSHProvider:Password"])) App.Configuration["SSHProvider:Port"].ToInt(), App.Configuration["SSHProvider:Username"], App.Configuration["SSHProvider:Password"]))
@ -180,7 +180,7 @@ public class SysFileService : IDynamicApiController, ITransient
[DisplayName("下载指定文件Base64格式")] [DisplayName("下载指定文件Base64格式")]
public async Task<string> DownloadFileBase64([FromBody] string url) public async Task<string> DownloadFileBase64([FromBody] string url)
{ {
if (_OSSProviderOptions.IsEnable) if (_OSSProviderOptions.Enabled)
{ {
using var httpClient = new HttpClient(); using var httpClient = new HttpClient();
HttpResponseMessage response = await httpClient.GetAsync(url); HttpResponseMessage response = await httpClient.GetAsync(url);
@ -195,7 +195,7 @@ public class SysFileService : IDynamicApiController, ITransient
throw new HttpRequestException($"Request failed with status code: {response.StatusCode}"); throw new HttpRequestException($"Request failed with status code: {response.StatusCode}");
} }
} }
else if (App.Configuration["SSHProvider:IsEnable"].ToBoolean()) else if (App.Configuration["SSHProvider:Enabled"].ToBoolean())
{ {
var sysFile = await _sysFileRep.CopyNew().GetFirstAsync(u => u.Url == url) ?? throw Oops.Oh($"文件不存在"); var sysFile = await _sysFileRep.CopyNew().GetFirstAsync(u => u.Url == url) ?? throw Oops.Oh($"文件不存在");
using (SSHHelper helper = new SSHHelper(App.Configuration["SSHProvider:Host"], using (SSHHelper helper = new SSHHelper(App.Configuration["SSHProvider:Host"],
@ -236,11 +236,11 @@ public class SysFileService : IDynamicApiController, ITransient
{ {
await _sysFileRep.DeleteAsync(file); await _sysFileRep.DeleteAsync(file);
if (_OSSProviderOptions.IsEnable) if (_OSSProviderOptions.Enabled)
{ {
await _OSSService.RemoveObjectAsync(file.BucketName.ToString(), string.Concat(file.FilePath, "/", $"{input.Id}{file.Suffix}")); await _OSSService.RemoveObjectAsync(file.BucketName.ToString(), string.Concat(file.FilePath, "/", $"{input.Id}{file.Suffix}"));
} }
else if (App.Configuration["SSHProvider:IsEnable"].ToBoolean()) else if (App.Configuration["SSHProvider:Enabled"].ToBoolean())
{ {
var fullPath = string.Concat(file.FilePath, "/", file.Id + file.Suffix); var fullPath = string.Concat(file.FilePath, "/", file.Id + file.Suffix);
using (SSHHelper helper = new SSHHelper(App.Configuration["SSHProvider:Host"], using (SSHHelper helper = new SSHHelper(App.Configuration["SSHProvider:Host"],
@ -349,10 +349,10 @@ public class SysFileService : IDynamicApiController, ITransient
var newFile = new SysFile var newFile = new SysFile
{ {
Id = YitIdHelper.NextId(), Id = YitIdHelper.NextId(),
// BucketName = _OSSProviderOptions.IsEnable ? _OSSProviderOptions.Provider.ToString() : "Local", // BucketName = _OSSProviderOptions.Enabled ? _OSSProviderOptions.Provider.ToString() : "Local",
// 阿里云对bucket名称有要求1.只能包括小写字母,数字,短横线(-2.必须以小写字母或者数字开头 3.长度必须在3-63字节之间 // 阿里云对bucket名称有要求1.只能包括小写字母,数字,短横线(-2.必须以小写字母或者数字开头 3.长度必须在3-63字节之间
// 无法使用Provider // 无法使用Provider
BucketName = _OSSProviderOptions.IsEnable ? _OSSProviderOptions.Bucket : "Local", BucketName = _OSSProviderOptions.Enabled ? _OSSProviderOptions.Bucket : "Local",
FileName = Path.GetFileNameWithoutExtension(file.FileName), FileName = Path.GetFileNameWithoutExtension(file.FileName),
Suffix = suffix, Suffix = suffix,
SizeKb = sizeKb, SizeKb = sizeKb,
@ -363,7 +363,7 @@ public class SysFileService : IDynamicApiController, ITransient
}; };
var finalName = newFile.Id + suffix; // 文件最终名称 var finalName = newFile.Id + suffix; // 文件最终名称
if (_OSSProviderOptions.IsEnable) if (_OSSProviderOptions.Enabled)
{ {
newFile.Provider = Enum.GetName(_OSSProviderOptions.Provider); newFile.Provider = Enum.GetName(_OSSProviderOptions.Provider);
var filePath = string.Concat(path, "/", finalName); var filePath = string.Concat(path, "/", finalName);
@ -391,7 +391,7 @@ public class SysFileService : IDynamicApiController, ITransient
break; break;
} }
} }
else if (App.Configuration["SSHProvider:IsEnable"].ToBoolean()) else if (App.Configuration["SSHProvider:Enabled"].ToBoolean())
{ {
var fullPath = string.Concat(path.StartsWith('/') ? path : "/" + path, "/", finalName); var fullPath = string.Concat(path.StartsWith('/') ? path : "/" + path, "/", finalName);
using (SSHHelper helper = new SSHHelper(App.Configuration["SSHProvider:Host"], using (SSHHelper helper = new SSHHelper(App.Configuration["SSHProvider:Host"],

View File

@ -68,6 +68,7 @@ public class Startup : AppStartup
// 任务调度 // 任务调度
services.AddSchedule(options => services.AddSchedule(options =>
{ {
if(App.GetConfig<bool>("Cache:Redis:AutoDetect", true))
options.AddPersistence<DbJobPersistence>(); // 添加作业持久化器 options.AddPersistence<DbJobPersistence>(); // 添加作业持久化器
options.AddMonitor<JobMonitor>(); // 添加作业执行监视器 options.AddMonitor<JobMonitor>(); // 添加作业执行监视器
}); });