😎1、调整系统配置参数与常量 2、去掉无效的接口(获取水印配置)
This commit is contained in:
parent
1569f61bf3
commit
acf1ea7d1b
@ -59,12 +59,12 @@ public class AppAuthService : IDynamicApiController, ITransient
|
|||||||
// 判断密码错误次数(缓存30分钟)
|
// 判断密码错误次数(缓存30分钟)
|
||||||
var keyPasswordErrorTimes = $"{CacheConst.KeyPasswordErrorTimes}{input.Account}";
|
var keyPasswordErrorTimes = $"{CacheConst.KeyPasswordErrorTimes}{input.Account}";
|
||||||
var passwordErrorTimes = _sysCacheService.Get<int>(keyPasswordErrorTimes);
|
var passwordErrorTimes = _sysCacheService.Get<int>(keyPasswordErrorTimes);
|
||||||
var passwdMaxErrorTimes = await _sysConfigService.GetConfigValue<int>(CommonConst.SysPasswordMaxErrorTimes);
|
var passwdMaxErrorTimes = await _sysConfigService.GetConfigValue<int>(ConfigConst.SysPasswordMaxErrorTimes);
|
||||||
if (passwordErrorTimes >= passwdMaxErrorTimes)
|
if (passwordErrorTimes >= passwdMaxErrorTimes)
|
||||||
throw Oops.Oh(ErrorCodeEnum.D1027);
|
throw Oops.Oh(ErrorCodeEnum.D1027);
|
||||||
|
|
||||||
// 是否开启验证码
|
// 是否开启验证码
|
||||||
if (await _sysConfigService.GetConfigValue<bool>(CommonConst.SysCaptcha))
|
if (await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysCaptcha))
|
||||||
{
|
{
|
||||||
// 判断验证码
|
// 判断验证码
|
||||||
if (!_captcha.Validate(input.CodeId.ToString(), input.Code))
|
if (!_captcha.Validate(input.CodeId.ToString(), input.Code))
|
||||||
|
|||||||
@ -12,91 +12,11 @@ namespace Admin.NET.Core;
|
|||||||
[Const("平台配置")]
|
[Const("平台配置")]
|
||||||
public class CommonConst
|
public class CommonConst
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 演示环境开关
|
|
||||||
/// </summary>
|
|
||||||
public const string SysDemoEnv = "sys_demo";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 默认密码
|
|
||||||
/// </summary>
|
|
||||||
public const string SysPassword = "sys_password";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 密码最大错误次数
|
|
||||||
/// </summary>
|
|
||||||
public const string SysPasswordMaxErrorTimes = "sys_password_max_error_times";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 登录二次验证
|
|
||||||
/// </summary>
|
|
||||||
public const string SysSecondVer = "sys_second_ver";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 开启图形验证码
|
|
||||||
/// </summary>
|
|
||||||
public const string SysCaptcha = "sys_captcha";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 开启水印
|
|
||||||
/// </summary>
|
|
||||||
public const string SysWatermark = "sys_watermark";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 开启操作日志
|
|
||||||
/// </summary>
|
|
||||||
public const string SysOpLog = "sys_oplog";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Token过期时间
|
|
||||||
/// </summary>
|
|
||||||
public const string SysTokenExpire = "sys_token_expire";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// RefreshToken过期时间
|
|
||||||
/// </summary>
|
|
||||||
public const string SysRefreshTokenExpire = "sys_refresh_token_expire";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 开启发送异常日志邮件
|
|
||||||
/// </summary>
|
|
||||||
public const string SysErrorMail = "sys_error_mail";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 单用户登录
|
|
||||||
/// </summary>
|
|
||||||
public const string SysSingleLogin = "sys_single_login";
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 系统管理员角色编码
|
/// 系统管理员角色编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string SysAdminRole = "sys_admin";
|
public const string SysAdminRole = "sys_admin";
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// 开启全局脱敏处理(默认不开启)
|
|
||||||
///// </summary>
|
|
||||||
//public static bool SysSensitiveDetection = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 开启域登录验证
|
|
||||||
/// </summary>
|
|
||||||
public const string SysDomainLogin = "sys_domain_login";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 开启记录数据校验日志
|
|
||||||
/// </summary>
|
|
||||||
public const string SysValidationLog = "sys_validation_log";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 行政区域同步层级 1-省级,2-市级,3-区县级,4-街道级,5-村级
|
|
||||||
/// </summary>
|
|
||||||
public const string SysRegionSyncLevel = "sys_region_sync_level";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 日志保留天数
|
|
||||||
/// </summary>
|
|
||||||
public const string SysLogRetentionDays = "sys_log_retention_days";
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 日志分组名称
|
/// 日志分组名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -11,6 +11,76 @@ namespace Admin.NET.Core;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class ConfigConst
|
public class ConfigConst
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 演示环境
|
||||||
|
/// </summary>
|
||||||
|
public const string SysDemoEnv = "sys_demo";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 默认密码
|
||||||
|
/// </summary>
|
||||||
|
public const string SysPassword = "sys_password";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 密码最大错误次数
|
||||||
|
/// </summary>
|
||||||
|
public const string SysPasswordMaxErrorTimes = "sys_password_max_error_times";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 日志保留天数
|
||||||
|
/// </summary>
|
||||||
|
public const string SysLogRetentionDays = "sys_log_retention_days";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 记录操作日志
|
||||||
|
/// </summary>
|
||||||
|
public const string SysOpLog = "sys_oplog";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单设备登录
|
||||||
|
/// </summary>
|
||||||
|
public const string SysSingleLogin = "sys_single_login";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 登录二次验证
|
||||||
|
/// </summary>
|
||||||
|
public const string SysSecondVer = "sys_second_ver";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图形验证码
|
||||||
|
/// </summary>
|
||||||
|
public const string SysCaptcha = "sys_captcha";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Token过期时间
|
||||||
|
/// </summary>
|
||||||
|
public const string SysTokenExpire = "sys_token_expire";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// RefreshToken过期时间
|
||||||
|
/// </summary>
|
||||||
|
public const string SysRefreshTokenExpire = "sys_refresh_token_expire";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 发送异常日志邮件
|
||||||
|
/// </summary>
|
||||||
|
public const string SysErrorMail = "sys_error_mail";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 域登录验证
|
||||||
|
/// </summary>
|
||||||
|
public const string SysDomainLogin = "sys_domain_login";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据校验日志
|
||||||
|
/// </summary>
|
||||||
|
public const string SysValidationLog = "sys_validation_log";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 行政区域同步层级 1-省级,2-市级,3-区县级,4-街道级,5-村级
|
||||||
|
/// </summary>
|
||||||
|
public const string SysRegionSyncLevel = "sys_region_sync_level";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// WebConfig 分组
|
/// WebConfig 分组
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -61,7 +61,7 @@ public class OnlineUserHub : Hub<IOnlineUserHub>
|
|||||||
await _sysOnlineUerRep.InsertAsync(user);
|
await _sysOnlineUerRep.InsertAsync(user);
|
||||||
|
|
||||||
// 是否开启单用户登录
|
// 是否开启单用户登录
|
||||||
if (await _sysConfigService.GetConfigValue<bool>(CommonConst.SysSingleLogin))
|
if (await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysSingleLogin))
|
||||||
{
|
{
|
||||||
_sysCacheService.Set(CacheConst.KeyUserOnline + user.UserId, user);
|
_sysCacheService.Set(CacheConst.KeyUserOnline + user.UserId, user);
|
||||||
}
|
}
|
||||||
@ -102,7 +102,7 @@ public class OnlineUserHub : Hub<IOnlineUserHub>
|
|||||||
await _sysOnlineUerRep.DeleteAsync(u => u.Id == user.Id);
|
await _sysOnlineUerRep.DeleteAsync(u => u.Id == user.Id);
|
||||||
|
|
||||||
// 是否开启单用户登录
|
// 是否开启单用户登录
|
||||||
if (await _sysConfigService.GetConfigValue<bool>(CommonConst.SysSingleLogin))
|
if (await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysSingleLogin))
|
||||||
{
|
{
|
||||||
_sysCacheService.Remove(CacheConst.KeyUserOnline + user.UserId);
|
_sysCacheService.Remove(CacheConst.KeyUserOnline + user.UserId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,10 +31,10 @@ public class LogJob : IJob
|
|||||||
var logDiffRep = serviceScope.ServiceProvider.GetRequiredService<SqlSugarRepository<SysLogDiff>>();
|
var logDiffRep = serviceScope.ServiceProvider.GetRequiredService<SqlSugarRepository<SysLogDiff>>();
|
||||||
var sysConfigService = serviceScope.ServiceProvider.GetRequiredService<SysConfigService>();
|
var sysConfigService = serviceScope.ServiceProvider.GetRequiredService<SysConfigService>();
|
||||||
|
|
||||||
var daysAgo = await sysConfigService.GetConfigValue<int>(CommonConst.SysLogRetentionDays); // 日志保留天数
|
var daysAgo = await sysConfigService.GetConfigValue<int>(ConfigConst.SysLogRetentionDays); // 日志保留天数
|
||||||
await logVisRep.CopyNew().AsDeleteable().Where(u => (DateTime)u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除访问日志
|
await logVisRep.CopyNew().AsDeleteable().Where(u => u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除访问日志
|
||||||
await logOpRep.CopyNew().AsDeleteable().Where(u => (DateTime)u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除操作日志
|
await logOpRep.CopyNew().AsDeleteable().Where(u => u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除操作日志
|
||||||
await logDiffRep.CopyNew().AsDeleteable().Where(u => (DateTime)u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除差异日志
|
await logDiffRep.CopyNew().AsDeleteable().Where(u => u.CreateTime < DateTime.Now.AddDays(-daysAgo)).ExecuteCommandAsync(stoppingToken); // 删除差异日志
|
||||||
|
|
||||||
string msg = $"【{DateTime.Now}】清理系统日志成功,删除 {daysAgo} 天前的日志数据!";
|
string msg = $"【{DateTime.Now}】清理系统日志成功,删除 {daysAgo} 天前的日志数据!";
|
||||||
var originColor = Console.ForegroundColor;
|
var originColor = Console.ForegroundColor;
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class DatabaseLoggingWriter : IDatabaseLoggingWriter, IDisposable
|
|||||||
|
|
||||||
var loggingMonitor = JSON.Deserialize<dynamic>(jsonStr);
|
var loggingMonitor = JSON.Deserialize<dynamic>(jsonStr);
|
||||||
// 记录数据校验日志
|
// 记录数据校验日志
|
||||||
if (loggingMonitor.validation != null && !await _sysConfigService.GetConfigValue<bool>(CommonConst.SysValidationLog)) return;
|
if (loggingMonitor.validation != null && !await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysValidationLog)) return;
|
||||||
|
|
||||||
// 获取当前操作者
|
// 获取当前操作者
|
||||||
string account = "", realName = "", userId = "", tenantId = "";
|
string account = "", realName = "", userId = "", tenantId = "";
|
||||||
@ -125,7 +125,7 @@ public class DatabaseLoggingWriter : IDatabaseLoggingWriter, IDisposable
|
|||||||
}).ExecuteCommandAsync();
|
}).ExecuteCommandAsync();
|
||||||
|
|
||||||
// 将异常日志发送到邮件
|
// 将异常日志发送到邮件
|
||||||
if (await _sysConfigService.GetConfigValue<bool>(CommonConst.SysErrorMail))
|
if (await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysErrorMail))
|
||||||
{
|
{
|
||||||
await App.GetRequiredService<IEventPublisher>().PublishAsync(CommonConst.SendErrorMail, logMsg.Exception ?? loggingMonitor.exception);
|
await App.GetRequiredService<IEventPublisher>().PublishAsync(CommonConst.SendErrorMail, logMsg.Exception ?? loggingMonitor.exception);
|
||||||
}
|
}
|
||||||
@ -160,7 +160,7 @@ public class DatabaseLoggingWriter : IDatabaseLoggingWriter, IDisposable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 记录操作日志
|
// 记录操作日志
|
||||||
if (!await _sysConfigService.GetConfigValue<bool>(CommonConst.SysOpLog)) return;
|
if (!await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysOpLog)) return;
|
||||||
await _db.Insertable(new SysLogOp
|
await _db.Insertable(new SysLogOp
|
||||||
{
|
{
|
||||||
ControllerName = loggingMonitor.controllerName,
|
ControllerName = loggingMonitor.controllerName,
|
||||||
|
|||||||
@ -27,7 +27,7 @@ public class ElasticSearchLoggingWriter : IDatabaseLoggingWriter, IDisposable
|
|||||||
public async Task WriteAsync(LogMessage logMsg, bool flush)
|
public async Task WriteAsync(LogMessage logMsg, bool flush)
|
||||||
{
|
{
|
||||||
// 是否启用操作日志
|
// 是否启用操作日志
|
||||||
var sysOpLogEnabled = await _sysConfigService.GetConfigValue<bool>(CommonConst.SysOpLog);
|
var sysOpLogEnabled = await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysOpLog);
|
||||||
if (!sysOpLogEnabled) return;
|
if (!sysOpLogEnabled) return;
|
||||||
|
|
||||||
var jsonStr = logMsg.Context?.Get("loggingMonitor")?.ToString();
|
var jsonStr = logMsg.Context?.Get("loggingMonitor")?.ToString();
|
||||||
|
|||||||
@ -19,28 +19,28 @@ public class SysConfigSeedData : ISqlSugarEntitySeedData<SysConfig>
|
|||||||
{
|
{
|
||||||
return new[]
|
return new[]
|
||||||
{
|
{
|
||||||
new SysConfig{ Id=1300000000101, Name="演示环境", Code="sys_demo", Value="False", SysFlag=YesNoEnum.Y, Remark="演示环境", OrderNo=10, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000101, Name="演示环境", Code=ConfigConst.SysDemoEnv, Value="False", SysFlag=YesNoEnum.Y, Remark="演示环境", OrderNo=10, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000111, Name="默认密码", Code="sys_password", Value="123456", SysFlag=YesNoEnum.Y, Remark="默认密码", OrderNo=20, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000111, Name="默认密码", Code=ConfigConst.SysPassword, Value="123456", SysFlag=YesNoEnum.Y, Remark="默认密码", OrderNo=20, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000121, Name="密码最大错误次数", Code="sys_password_max_error_times", Value="5", SysFlag=YesNoEnum.Y, Remark="允许密码最大输入错误次数", OrderNo=30, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000121, Name="密码最大错误次数", Code=ConfigConst.SysPasswordMaxErrorTimes, Value="5", SysFlag=YesNoEnum.Y, Remark="允许密码最大输入错误次数", OrderNo=30, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000131, Name="日志保留天数", Code="sys_log_retention_days", Value="180", SysFlag=YesNoEnum.Y, Remark="日志保留天数(天)", OrderNo=40, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000131, Name="日志保留天数", Code=ConfigConst.SysLogRetentionDays, Value="180", SysFlag=YesNoEnum.Y, Remark="日志保留天数(天)", OrderNo=40, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000141, Name="记录操作日志", Code="sys_oplog", Value="True", SysFlag=YesNoEnum.Y, Remark="是否记录操作日志", OrderNo=50, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000141, Name="记录操作日志", Code=ConfigConst.SysOpLog, Value="True", SysFlag=YesNoEnum.Y, Remark="是否记录操作日志", OrderNo=50, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000151, Name="开启单设备登录", Code="sys_single_login", Value="False", SysFlag=YesNoEnum.Y, Remark="是否开启单设备登录", OrderNo=60, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000151, Name="单设备登录", Code=ConfigConst.SysSingleLogin, Value="False", SysFlag=YesNoEnum.Y, Remark="是否开启单设备登录", OrderNo=60, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000161, Name="开启登录二次验证", Code="sys_second_ver", Value="False", SysFlag=YesNoEnum.Y, Remark="是否开启登录二次验证", OrderNo=70, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000161, Name="登录二次验证", Code=ConfigConst.SysSecondVer, Value="False", SysFlag=YesNoEnum.Y, Remark="是否开启登录二次验证", OrderNo=70, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000171, Name="开启图形验证码", Code="sys_captcha", Value="True", SysFlag=YesNoEnum.Y, Remark="是否开启图形验证码", OrderNo=80, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000171, Name="图形验证码", Code=ConfigConst.SysCaptcha, Value="True", SysFlag=YesNoEnum.Y, Remark="是否开启图形验证码", OrderNo=80, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000181, Name="Token过期时间", Code="sys_token_expire", Value="10080", SysFlag=YesNoEnum.Y, Remark="Token过期时间(分钟)", OrderNo=90, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000181, Name="Token过期时间", Code=ConfigConst.SysTokenExpire, Value="10080", SysFlag=YesNoEnum.Y, Remark="Token过期时间(分钟)", OrderNo=90, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000191, Name="刷新Token过期时间", Code="sys_refresh_token_expire", Value="20160", SysFlag=YesNoEnum.Y, Remark="刷新Token过期时间(分钟)(一般 refresh_token 的有效时间 > 2 * access_token 的有效时间)", OrderNo=100, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000191, Name="RefreshToken过期时间", Code=ConfigConst.SysRefreshTokenExpire, Value="20160", SysFlag=YesNoEnum.Y, Remark="刷新Token过期时间(分钟)(一般 refresh_token 的有效时间 > 2 * access_token 的有效时间)", OrderNo=100, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000201, Name="发送异常日志邮件", Code="sys_error_mail", Value="True", SysFlag=YesNoEnum.Y, Remark="是否发送异常日志邮件", OrderNo=110, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000201, Name="发送异常日志邮件", Code=ConfigConst.SysErrorMail, Value="True", SysFlag=YesNoEnum.Y, Remark="是否发送异常日志邮件", OrderNo=110, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000211, Name="开启域登录验证", Code="sys_domain_login", Value="False", SysFlag=YesNoEnum.Y, Remark="是否开启域登录验证", OrderNo=120, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000211, Name="域登录验证", Code=ConfigConst.SysDomainLogin, Value="False", SysFlag=YesNoEnum.Y, Remark="是否开启域登录验证", OrderNo=120, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000221, Name="开启数据校验日志", Code="sys_validation_log", Value="True", SysFlag=YesNoEnum.Y, Remark="是否数据校验日志", OrderNo=130, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000221, Name="数据校验日志", Code=ConfigConst.SysValidationLog, Value="True", SysFlag=YesNoEnum.Y, Remark="是否数据校验日志", OrderNo=130, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000231, Name="行政区域同步层级", Code="sys_region_sync_level", Value="3", SysFlag=YesNoEnum.Y, Remark="行政区域同步层级 1-省级,2-市级,3-区县级,4-街道级,5-村级", OrderNo=140, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000231, Name="行政区域同步层级", Code=ConfigConst.SysRegionSyncLevel, Value="3", SysFlag=YesNoEnum.Y, Remark="行政区域同步层级 1-省级,2-市级,3-区县级,4-街道级,5-村级", OrderNo=140, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000301, Name="系统主标题", Code="sys_web_title", Value="Admin.NET.Pro", SysFlag=YesNoEnum.Y, Remark="系统主标题", OrderNo=300, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000301, Name="系统主标题", Code=ConfigConst.SysWebTitle, Value="Admin.NET.Pro", SysFlag=YesNoEnum.Y, Remark="系统主标题", OrderNo=300, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000311, Name="系统副标题", Code="sys_web_viceTitle", Value="Admin.NET.Pro", SysFlag=YesNoEnum.Y, Remark="系统副标题", OrderNo=310, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000311, Name="系统副标题", Code=ConfigConst.SysWebViceTitle, Value="Admin.NET.Pro", SysFlag=YesNoEnum.Y, Remark="系统副标题", OrderNo=310, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000321, Name="系统描述", Code="sys_web_viceDesc", Value="站在巨人肩膀上的 .NET 通用权限开发框架", SysFlag=YesNoEnum.Y, Remark="系统描述", OrderNo=320, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000321, Name="系统描述", Code=ConfigConst.SysWebViceDesc, Value="站在巨人肩膀上的 .NET 通用权限开发框架", SysFlag=YesNoEnum.Y, Remark="系统描述", OrderNo=320, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000331, Name="水印内容", Code="sys_web_watermark", Value="Admin.NET.Pro", SysFlag=YesNoEnum.Y, Remark="水印内容", OrderNo=330, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000331, Name="水印内容", Code=ConfigConst.SysWebWatermark, Value="Admin.NET.Pro", SysFlag=YesNoEnum.Y, Remark="水印内容", OrderNo=330, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000341, Name="版权说明", Code="sys_web_copyright", Value="Copyright © 2021-present Admin.NET All rights reserved.", SysFlag=YesNoEnum.Y, Remark="版权说明", OrderNo=340, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000341, Name="版权说明", Code=ConfigConst.SysWebCopyright, Value="Copyright © 2021-present Admin.NET All rights reserved.", SysFlag=YesNoEnum.Y, Remark="版权说明", OrderNo=340, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000351, Name="系统图标", Code="sys_web_logo", Value="/Upload/logo.png", SysFlag=YesNoEnum.Y, Remark="系统图标", OrderNo=350, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000351, Name="系统图标", Code=ConfigConst.SysWebLogo, Value="/Upload/logo.png", SysFlag=YesNoEnum.Y, Remark="系统图标", OrderNo=350, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000361, Name="ICP备案号", Code="sys_web_icp", Value="省ICP备12345678号", SysFlag=YesNoEnum.Y, Remark="ICP备案号", OrderNo=360, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000361, Name="ICP备案号", Code=ConfigConst.SysWebIcp, Value="省ICP备12345678号", SysFlag=YesNoEnum.Y, Remark="ICP备案号", OrderNo=360, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000371, Name="ICP地址", Code="sys_web_icpUrl", Value="https://beian.miit.gov.cn", SysFlag=YesNoEnum.Y, Remark="ICP地址", OrderNo=370, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000371, Name="ICP地址", Code=ConfigConst.SysWebIcpUrl, Value="https://beian.miit.gov.cn", SysFlag=YesNoEnum.Y, Remark="ICP地址", OrderNo=370, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -65,12 +65,12 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
// 判断密码错误次数(缓存30分钟)
|
// 判断密码错误次数(缓存30分钟)
|
||||||
var keyPasswordErrorTimes = $"{CacheConst.KeyPasswordErrorTimes}{input.Account}";
|
var keyPasswordErrorTimes = $"{CacheConst.KeyPasswordErrorTimes}{input.Account}";
|
||||||
var passwordErrorTimes = _sysCacheService.Get<int>(keyPasswordErrorTimes);
|
var passwordErrorTimes = _sysCacheService.Get<int>(keyPasswordErrorTimes);
|
||||||
var passwdMaxErrorTimes = await _sysConfigService.GetConfigValue<int>(CommonConst.SysPasswordMaxErrorTimes);
|
var passwdMaxErrorTimes = await _sysConfigService.GetConfigValue<int>(ConfigConst.SysPasswordMaxErrorTimes);
|
||||||
if (passwordErrorTimes >= passwdMaxErrorTimes)
|
if (passwordErrorTimes >= passwdMaxErrorTimes)
|
||||||
throw Oops.Oh(ErrorCodeEnum.D1027);
|
throw Oops.Oh(ErrorCodeEnum.D1027);
|
||||||
|
|
||||||
// 是否开启验证码
|
// 是否开启验证码
|
||||||
if (await _sysConfigService.GetConfigValue<bool>(CommonConst.SysCaptcha))
|
if (await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysCaptcha))
|
||||||
{
|
{
|
||||||
// 判断验证码
|
// 判断验证码
|
||||||
if (!_captcha.Validate(input.CodeId.ToString(), input.Code))
|
if (!_captcha.Validate(input.CodeId.ToString(), input.Code))
|
||||||
@ -101,7 +101,7 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 是否开启域登录验证
|
// 是否开启域登录验证
|
||||||
if (await _sysConfigService.GetConfigValue<bool>(CommonConst.SysDomainLogin))
|
if (await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysDomainLogin))
|
||||||
{
|
{
|
||||||
var userLdap = await _sysUserLdap.GetFirstAsync(u => u.UserId == user.Id && u.TenantId == tenant.Id);
|
var userLdap = await _sysUserLdap.GetFirstAsync(u => u.UserId == user.Id && u.TenantId == tenant.Id);
|
||||||
if (userLdap == null)
|
if (userLdap == null)
|
||||||
@ -334,23 +334,11 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("获取登录配置")]
|
[DisplayName("获取登录配置")]
|
||||||
public async Task<dynamic> GetLoginConfig()
|
public async Task<dynamic> GetLoginConfig()
|
||||||
{
|
{
|
||||||
var secondVerEnabled = await _sysConfigService.GetConfigValue<bool>(CommonConst.SysSecondVer);
|
var secondVerEnabled = await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysSecondVer);
|
||||||
var captchaEnabled = await _sysConfigService.GetConfigValue<bool>(CommonConst.SysCaptcha);
|
var captchaEnabled = await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysCaptcha);
|
||||||
return new { SecondVerEnabled = secondVerEnabled, CaptchaEnabled = captchaEnabled };
|
return new { SecondVerEnabled = secondVerEnabled, CaptchaEnabled = captchaEnabled };
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取水印配置 🔖
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
[SuppressMonitor]
|
|
||||||
[DisplayName("获取水印配置")]
|
|
||||||
public async Task<dynamic> GetWatermarkConfig()
|
|
||||||
{
|
|
||||||
var watermarkEnabled = await _sysConfigService.GetConfigValue<bool>(CommonConst.SysWatermark);
|
|
||||||
return new { WatermarkEnabled = watermarkEnabled };
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取验证码 🔖
|
/// 获取验证码 🔖
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -389,7 +377,7 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_sysCacheService.Set($"{CacheConst.KeyConfig}{CommonConst.SysCaptcha}", false);
|
_sysCacheService.Set($"{CacheConst.KeyConfig}{ConfigConst.SysCaptcha}", false);
|
||||||
|
|
||||||
await Login(new LoginInput
|
await Login(new LoginInput
|
||||||
{
|
{
|
||||||
@ -397,7 +385,7 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
Password = CryptogramUtil.SM2Encrypt(auth.Password),
|
Password = CryptogramUtil.SM2Encrypt(auth.Password),
|
||||||
});
|
});
|
||||||
|
|
||||||
_sysCacheService.Remove($"{CacheConst.KeyConfig}{CommonConst.SysCaptcha}");
|
_sysCacheService.Remove($"{CacheConst.KeyConfig}{ConfigConst.SysCaptcha}");
|
||||||
|
|
||||||
return 200;
|
return 200;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -195,7 +195,7 @@ public class SysConfigService : IDynamicApiController, ITransient
|
|||||||
[NonAction]
|
[NonAction]
|
||||||
public async Task<int> GetTokenExpire()
|
public async Task<int> GetTokenExpire()
|
||||||
{
|
{
|
||||||
var tokenExpireStr = await GetConfigValue<string>(CommonConst.SysTokenExpire);
|
var tokenExpireStr = await GetConfigValue<string>(ConfigConst.SysTokenExpire);
|
||||||
_ = int.TryParse(tokenExpireStr, out var tokenExpire);
|
_ = int.TryParse(tokenExpireStr, out var tokenExpire);
|
||||||
return tokenExpire == 0 ? 20 : tokenExpire;
|
return tokenExpire == 0 ? 20 : tokenExpire;
|
||||||
}
|
}
|
||||||
@ -207,7 +207,7 @@ public class SysConfigService : IDynamicApiController, ITransient
|
|||||||
[NonAction]
|
[NonAction]
|
||||||
public async Task<int> GetRefreshTokenExpire()
|
public async Task<int> GetRefreshTokenExpire()
|
||||||
{
|
{
|
||||||
var refreshTokenExpireStr = await GetConfigValue<string>(CommonConst.SysRefreshTokenExpire);
|
var refreshTokenExpireStr = await GetConfigValue<string>(ConfigConst.SysRefreshTokenExpire);
|
||||||
_ = int.TryParse(refreshTokenExpireStr, out var refreshTokenExpire);
|
_ = int.TryParse(refreshTokenExpireStr, out var refreshTokenExpire);
|
||||||
return refreshTokenExpire == 0 ? 40 : refreshTokenExpire;
|
return refreshTokenExpire == 0 ? 40 : refreshTokenExpire;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,7 +30,7 @@ public class JobMonitor : IJobMonitor
|
|||||||
public async Task OnExecutedAsync(JobExecutedContext context, CancellationToken stoppingToken)
|
public async Task OnExecutedAsync(JobExecutedContext context, CancellationToken stoppingToken)
|
||||||
{
|
{
|
||||||
// 将异常作业发送到邮件
|
// 将异常作业发送到邮件
|
||||||
if (await _sysConfigService.GetConfigValue<bool>(CommonConst.SysErrorMail) && context.Exception != null)
|
if (await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysErrorMail) && context.Exception != null)
|
||||||
{
|
{
|
||||||
var errorInfo = $"【{context.Trigger.Description}】定时任务错误:{context.Exception}";
|
var errorInfo = $"【{context.Trigger.Description}】定时任务错误:{context.Exception}";
|
||||||
await _eventPublisher.PublishAsync(CommonConst.SendErrorMail, errorInfo, stoppingToken);
|
await _eventPublisher.PublishAsync(CommonConst.SendErrorMail, errorInfo, stoppingToken);
|
||||||
|
|||||||
@ -48,7 +48,7 @@ public class SysMessageService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
var cacheKey = CacheConst.KeyUserOnline + input.ReceiveUserId;
|
var cacheKey = CacheConst.KeyUserOnline + input.ReceiveUserId;
|
||||||
// 是否开启单用户登录
|
// 是否开启单用户登录
|
||||||
if (await _sysConfigService.GetConfigValue<bool>(CommonConst.SysSingleLogin))
|
if (await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysSingleLogin))
|
||||||
{
|
{
|
||||||
var user = _sysCacheService.Get<SysOnlineUser>(cacheKey);
|
var user = _sysCacheService.Get<SysOnlineUser>(cacheKey);
|
||||||
if (user == null) return;
|
if (user == null) return;
|
||||||
@ -76,7 +76,7 @@ public class SysMessageService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
var cacheKey = CacheConst.KeyUserOnline + input.ReceiveUserId;
|
var cacheKey = CacheConst.KeyUserOnline + input.ReceiveUserId;
|
||||||
// 是否开启单用户登录
|
// 是否开启单用户登录
|
||||||
if (await _sysConfigService.GetConfigValue<bool>(CommonConst.SysSingleLogin))
|
if (await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysSingleLogin))
|
||||||
{
|
{
|
||||||
var user = _sysCacheService.Get<SysOnlineUser>(cacheKey);
|
var user = _sysCacheService.Get<SysOnlineUser>(cacheKey);
|
||||||
if (user == null) return;
|
if (user == null) return;
|
||||||
@ -107,7 +107,7 @@ public class SysMessageService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
var cacheKey = CacheConst.KeyUserOnline + userId;
|
var cacheKey = CacheConst.KeyUserOnline + userId;
|
||||||
// 是否开启单用户登录
|
// 是否开启单用户登录
|
||||||
if (await _sysConfigService.GetConfigValue<bool>(CommonConst.SysSingleLogin))
|
if (await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysSingleLogin))
|
||||||
{
|
{
|
||||||
var user = _sysCacheService.Get<SysOnlineUser>(cacheKey);
|
var user = _sysCacheService.Get<SysOnlineUser>(cacheKey);
|
||||||
if (user != null) userList.Add(user.ConnectionId);
|
if (user != null) userList.Add(user.ConnectionId);
|
||||||
|
|||||||
@ -78,7 +78,7 @@ public class SysOnlineUserService : IDynamicApiController, ITransient
|
|||||||
[NonAction]
|
[NonAction]
|
||||||
public async Task SingleLogin(long userId)
|
public async Task SingleLogin(long userId)
|
||||||
{
|
{
|
||||||
if (await _sysConfigService.GetConfigValue<bool>(CommonConst.SysSingleLogin))
|
if (await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysSingleLogin))
|
||||||
{
|
{
|
||||||
var users = await _sysOnlineUerRep.GetListAsync(u => u.UserId == userId);
|
var users = await _sysOnlineUerRep.GetListAsync(u => u.UserId == userId);
|
||||||
foreach (var user in users)
|
foreach (var user in users)
|
||||||
|
|||||||
@ -149,7 +149,7 @@ public class SysRegionService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("同步行政区域")]
|
[DisplayName("同步行政区域")]
|
||||||
public async Task Sync()
|
public async Task Sync()
|
||||||
{
|
{
|
||||||
var syncLevel = await _sysConfigService.GetConfigValue<int>(CommonConst.SysRegionSyncLevel);
|
var syncLevel = await _sysConfigService.GetConfigValue<int>(ConfigConst.SysRegionSyncLevel);
|
||||||
if (syncLevel < 1 || syncLevel > 5)
|
if (syncLevel < 1 || syncLevel > 5)
|
||||||
syncLevel = 3;//默认区县级
|
syncLevel = 3;//默认区县级
|
||||||
var context = BrowsingContext.New(AngleSharp.Configuration.Default.WithDefaultLoader());
|
var context = BrowsingContext.New(AngleSharp.Configuration.Default.WithDefaultLoader());
|
||||||
|
|||||||
@ -210,7 +210,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
|||||||
await _sysPosRep.InsertAsync(newPos);
|
await _sysPosRep.InsertAsync(newPos);
|
||||||
|
|
||||||
// 初始化系统账号
|
// 初始化系统账号
|
||||||
var password = await _sysConfigService.GetConfigValue<string>(CommonConst.SysPassword);
|
var password = await _sysConfigService.GetConfigValue<string>(ConfigConst.SysPassword);
|
||||||
var newUser = new SysUser
|
var newUser = new SysUser
|
||||||
{
|
{
|
||||||
Id = tenantId,
|
Id = tenantId,
|
||||||
@ -375,7 +375,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("重置租户管理员密码")]
|
[DisplayName("重置租户管理员密码")]
|
||||||
public async Task<string> ResetPwd(TenantUserInput input)
|
public async Task<string> ResetPwd(TenantUserInput input)
|
||||||
{
|
{
|
||||||
var password = await _sysConfigService.GetConfigValue<string>(CommonConst.SysPassword);
|
var password = await _sysConfigService.GetConfigValue<string>(ConfigConst.SysPassword);
|
||||||
var encryptPassword = CryptogramUtil.Encrypt(password);
|
var encryptPassword = CryptogramUtil.Encrypt(password);
|
||||||
await _sysUserRep.UpdateAsync(u => new SysUser() { Password = encryptPassword }, u => u.Id == input.UserId);
|
await _sysUserRep.UpdateAsync(u => new SysUser() { Password = encryptPassword }, u => u.Id == input.UserId);
|
||||||
return password;
|
return password;
|
||||||
|
|||||||
@ -96,7 +96,7 @@ public class SysUserService : IDynamicApiController, ITransient
|
|||||||
var isExist = await _sysUserRep.AsQueryable().ClearFilter().AnyAsync(u => u.Account == input.Account);
|
var isExist = await _sysUserRep.AsQueryable().ClearFilter().AnyAsync(u => u.Account == input.Account);
|
||||||
if (isExist) throw Oops.Oh(ErrorCodeEnum.D1003);
|
if (isExist) throw Oops.Oh(ErrorCodeEnum.D1003);
|
||||||
|
|
||||||
var password = await _sysConfigService.GetConfigValue<string>(CommonConst.SysPassword);
|
var password = await _sysConfigService.GetConfigValue<string>(ConfigConst.SysPassword);
|
||||||
|
|
||||||
var user = input.Adapt<SysUser>();
|
var user = input.Adapt<SysUser>();
|
||||||
user.Password = CryptogramUtil.Encrypt(password);
|
user.Password = CryptogramUtil.Encrypt(password);
|
||||||
@ -317,7 +317,7 @@ public class SysUserService : IDynamicApiController, ITransient
|
|||||||
public virtual async Task<string> ResetPwd(ResetPwdUserInput input)
|
public virtual async Task<string> ResetPwd(ResetPwdUserInput input)
|
||||||
{
|
{
|
||||||
var user = await _sysUserRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D0009);
|
var user = await _sysUserRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D0009);
|
||||||
var password = await _sysConfigService.GetConfigValue<string>(CommonConst.SysPassword);
|
var password = await _sysConfigService.GetConfigValue<string>(ConfigConst.SysPassword);
|
||||||
user.Password = CryptogramUtil.Encrypt(password);
|
user.Password = CryptogramUtil.Encrypt(password);
|
||||||
await _sysUserRep.AsUpdateable(user).UpdateColumns(u => u.Password).ExecuteCommandAsync();
|
await _sysUserRep.AsUpdateable(user).UpdateColumns(u => u.Password).ExecuteCommandAsync();
|
||||||
|
|
||||||
|
|||||||
@ -125,20 +125,20 @@ public class VerifySignatureInput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 签名
|
/// 签名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string signature { get; set; }
|
public string Signature { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 时间戳
|
/// 时间戳
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string timestamp { get; set; }
|
public string Timestamp { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 随机数
|
/// 随机数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string nonce { get; set; }
|
public string Nonce { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 随机字符串
|
/// 随机字符串
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string echostr { get; set; }
|
public string Echostr { get; set; }
|
||||||
}
|
}
|
||||||
@ -123,13 +123,13 @@ public class SysWxOpenService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("验证签名")]
|
[DisplayName("验证签名")]
|
||||||
public string VerifySignature([FromQuery] VerifySignatureInput input)
|
public string VerifySignature([FromQuery] VerifySignatureInput input)
|
||||||
{
|
{
|
||||||
bool valid = _wechatApiClient.VerifyEventSignatureForEcho(input.timestamp, input.nonce, input.signature);
|
bool valid = _wechatApiClient.VerifyEventSignatureForEcho(input.Timestamp, input.Nonce, input.Signature);
|
||||||
if (!valid)
|
if (!valid)
|
||||||
{
|
{
|
||||||
return "fail";
|
return "fail";
|
||||||
}
|
}
|
||||||
|
|
||||||
return input.echostr;
|
return input.Echostr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -34,7 +34,7 @@ public class GoViewSysService : IDynamicApiController
|
|||||||
[DisplayName("GoView 登录")]
|
[DisplayName("GoView 登录")]
|
||||||
public async Task<GoViewLoginOutput> Login(GoViewLoginInput input)
|
public async Task<GoViewLoginOutput> Login(GoViewLoginInput input)
|
||||||
{
|
{
|
||||||
_sysCacheService.Set($"{CacheConst.KeyConfig}{CommonConst.SysCaptcha}", false);
|
_sysCacheService.Set($"{CacheConst.KeyConfig}{ConfigConst.SysCaptcha}", false);
|
||||||
|
|
||||||
input.Password = CryptogramUtil.SM2Encrypt(input.Password);
|
input.Password = CryptogramUtil.SM2Encrypt(input.Password);
|
||||||
var loginResult = await _sysAuthService.Login(new LoginInput()
|
var loginResult = await _sysAuthService.Login(new LoginInput()
|
||||||
@ -43,7 +43,7 @@ public class GoViewSysService : IDynamicApiController
|
|||||||
Password = input.Password,
|
Password = input.Password,
|
||||||
});
|
});
|
||||||
|
|
||||||
_sysCacheService.Remove($"{CacheConst.KeyConfig}{CommonConst.SysCaptcha}");
|
_sysCacheService.Remove($"{CacheConst.KeyConfig}{ConfigConst.SysCaptcha}");
|
||||||
|
|
||||||
var sysUser = await _sysUserRep.AsQueryable().ClearFilter().FirstAsync(u => u.Account.Equals(input.Username));
|
var sysUser = await _sysUserRep.AsQueryable().ClearFilter().FirstAsync(u => u.Account.Equals(input.Username));
|
||||||
return new GoViewLoginOutput()
|
return new GoViewLoginOutput()
|
||||||
|
|||||||
@ -501,49 +501,6 @@ export const SysAuthApiAxiosParamCreator = function (configuration?: Configurati
|
|||||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
|
||||||
return {
|
|
||||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
||||||
options: localVarRequestOptions,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 获取水印配置 🔖
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
*/
|
|
||||||
apiSysAuthWatermarkConfigGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
||||||
const localVarPath = `/api/sysAuth/watermarkConfig`;
|
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
||||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
||||||
let baseOptions;
|
|
||||||
if (configuration) {
|
|
||||||
baseOptions = configuration.baseOptions;
|
|
||||||
}
|
|
||||||
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
|
|
||||||
const localVarHeaderParameter = {} as any;
|
|
||||||
const localVarQueryParameter = {} as any;
|
|
||||||
|
|
||||||
// authentication Bearer required
|
|
||||||
// http bearer authentication required
|
|
||||||
if (configuration && configuration.accessToken) {
|
|
||||||
const accessToken = typeof configuration.accessToken === 'function'
|
|
||||||
? await configuration.accessToken()
|
|
||||||
: await configuration.accessToken;
|
|
||||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
const query = new URLSearchParams(localVarUrlObj.search);
|
|
||||||
for (const key in localVarQueryParameter) {
|
|
||||||
query.set(key, localVarQueryParameter[key]);
|
|
||||||
}
|
|
||||||
for (const key in options.params) {
|
|
||||||
query.set(key, options.params[key]);
|
|
||||||
}
|
|
||||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
||||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
||||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||||
options: localVarRequestOptions,
|
options: localVarRequestOptions,
|
||||||
@ -694,19 +651,6 @@ export const SysAuthApiFp = function(configuration?: Configuration) {
|
|||||||
return axios.request(axiosRequestArgs);
|
return axios.request(axiosRequestArgs);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 获取水印配置 🔖
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
*/
|
|
||||||
async apiSysAuthWatermarkConfigGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultObject>>> {
|
|
||||||
const localVarAxiosArgs = await SysAuthApiAxiosParamCreator(configuration).apiSysAuthWatermarkConfigGet(options);
|
|
||||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
||||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
||||||
return axios.request(axiosRequestArgs);
|
|
||||||
};
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -812,15 +756,6 @@ export const SysAuthApiFactory = function (configuration?: Configuration, basePa
|
|||||||
async apiSysAuthUserInfoGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultLoginUserOutput>> {
|
async apiSysAuthUserInfoGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultLoginUserOutput>> {
|
||||||
return SysAuthApiFp(configuration).apiSysAuthUserInfoGet(options).then((request) => request(axios, basePath));
|
return SysAuthApiFp(configuration).apiSysAuthUserInfoGet(options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 获取水印配置 🔖
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
*/
|
|
||||||
async apiSysAuthWatermarkConfigGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
|
|
||||||
return SysAuthApiFp(configuration).apiSysAuthWatermarkConfigGet(options).then((request) => request(axios, basePath));
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -937,14 +872,4 @@ export class SysAuthApi extends BaseAPI {
|
|||||||
public async apiSysAuthUserInfoGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultLoginUserOutput>> {
|
public async apiSysAuthUserInfoGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultLoginUserOutput>> {
|
||||||
return SysAuthApiFp(this.configuration).apiSysAuthUserInfoGet(options).then((request) => request(this.axios, this.basePath));
|
return SysAuthApiFp(this.configuration).apiSysAuthUserInfoGet(options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 获取水印配置 🔖
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
* @memberof SysAuthApi
|
|
||||||
*/
|
|
||||||
public async apiSysAuthWatermarkConfigGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
|
|
||||||
return SysAuthApiFp(this.configuration).apiSysAuthWatermarkConfigGet(options).then((request) => request(this.axios, this.basePath));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -200,19 +200,19 @@ export const SysWxOpenApiAxiosParamCreator = function (configuration?: Configura
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (signature !== undefined) {
|
if (signature !== undefined) {
|
||||||
localVarQueryParameter['signature'] = signature;
|
localVarQueryParameter['Signature'] = signature;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timestamp !== undefined) {
|
if (timestamp !== undefined) {
|
||||||
localVarQueryParameter['timestamp'] = timestamp;
|
localVarQueryParameter['Timestamp'] = timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nonce !== undefined) {
|
if (nonce !== undefined) {
|
||||||
localVarQueryParameter['nonce'] = nonce;
|
localVarQueryParameter['Nonce'] = nonce;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (echostr !== undefined) {
|
if (echostr !== undefined) {
|
||||||
localVarQueryParameter['echostr'] = echostr;
|
localVarQueryParameter['Echostr'] = echostr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const query = new URLSearchParams(localVarUrlObj.search);
|
const query = new URLSearchParams(localVarUrlObj.search);
|
||||||
|
|||||||
@ -30,6 +30,12 @@ export interface MemberInfo {
|
|||||||
*/
|
*/
|
||||||
memberType?: MemberTypes;
|
memberType?: MemberTypes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof MemberInfo
|
||||||
|
*/
|
||||||
|
name?: string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Type}
|
* @type {Type}
|
||||||
* @memberof MemberInfo
|
* @memberof MemberInfo
|
||||||
@ -42,12 +48,6 @@ export interface MemberInfo {
|
|||||||
*/
|
*/
|
||||||
reflectedType?: Type;
|
reflectedType?: Type;
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {string}
|
|
||||||
* @memberof MemberInfo
|
|
||||||
*/
|
|
||||||
name?: string | null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Module}
|
* @type {Module}
|
||||||
* @memberof MemberInfo
|
* @memberof MemberInfo
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user