Bug:Md5的模式无法登陆系统
Fix:执行SQL出错时,故定输入SQL语句的内容
This commit is contained in:
parent
1a97ca3ed8
commit
bcbde150d9
@ -1,4 +1,4 @@
|
|||||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||||
//
|
//
|
||||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||||
//
|
//
|
||||||
@ -155,6 +155,15 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
if (CryptogramUtil.CryptoType == CryptogramEnum.MD5.ToString())
|
if (CryptogramUtil.CryptoType == CryptogramEnum.MD5.ToString())
|
||||||
{
|
{
|
||||||
|
// 国密SM2解密(前端密码传输SM2加密后的)
|
||||||
|
try
|
||||||
|
{
|
||||||
|
password = CryptogramUtil.SM2Decrypt(password);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw Oops.Oh(ErrorCodeEnum.D0010);
|
||||||
|
}
|
||||||
if (user.Password.Equals(MD5Encryption.Encrypt(password))) return;
|
if (user.Password.Equals(MD5Encryption.Encrypt(password))) return;
|
||||||
|
|
||||||
_sysCacheService.Set(keyPasswordErrorTimes, ++passwordErrorTimes, TimeSpan.FromMinutes(30));
|
_sysCacheService.Set(keyPasswordErrorTimes, ++passwordErrorTimes, TimeSpan.FromMinutes(30));
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||||
//
|
//
|
||||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||||
//
|
//
|
||||||
@ -127,6 +127,13 @@ public static class SqlSugarSetup
|
|||||||
db.Ado.CommandTimeOut = 30;
|
db.Ado.CommandTimeOut = 30;
|
||||||
|
|
||||||
// 打印SQL语句
|
// 打印SQL语句
|
||||||
|
db.Aop.OnError = ex =>
|
||||||
|
{
|
||||||
|
if (ex.Parametres == null) return;
|
||||||
|
var log = $"【{DateTime.Now}——错误SQL】\r\n{UtilMethods.GetNativeSql(ex.Sql, (SugarParameter[])ex.Parametres)}\r\n";
|
||||||
|
Log.Error(log, ex);
|
||||||
|
App.PrintToMiniProfiler("SqlSugar", "Error", log);
|
||||||
|
};
|
||||||
if (enableConsoleSql)
|
if (enableConsoleSql)
|
||||||
{
|
{
|
||||||
db.Aop.OnLogExecuting = (sql, pars) =>
|
db.Aop.OnLogExecuting = (sql, pars) =>
|
||||||
@ -151,13 +158,6 @@ public static class SqlSugarSetup
|
|||||||
Console.ForegroundColor = originColor;
|
Console.ForegroundColor = originColor;
|
||||||
App.PrintToMiniProfiler("SqlSugar", "Info", log);
|
App.PrintToMiniProfiler("SqlSugar", "Info", log);
|
||||||
};
|
};
|
||||||
db.Aop.OnError = ex =>
|
|
||||||
{
|
|
||||||
if (ex.Parametres == null) return;
|
|
||||||
var log = $"【{DateTime.Now}——错误SQL】\r\n{UtilMethods.GetNativeSql(ex.Sql, (SugarParameter[])ex.Parametres)}\r\n";
|
|
||||||
Log.Error(log, ex);
|
|
||||||
App.PrintToMiniProfiler("SqlSugar", "Error", log);
|
|
||||||
};
|
|
||||||
db.Aop.OnLogExecuted = (sql, pars) =>
|
db.Aop.OnLogExecuted = (sql, pars) =>
|
||||||
{
|
{
|
||||||
//// 若参数值超过100个字符则进行截取
|
//// 若参数值超过100个字符则进行截取
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user