😎修复数据库连接字符串加解密sm2对应
This commit is contained in:
parent
babe0280e3
commit
4c71084e63
@ -83,7 +83,7 @@ public sealed class DbSettings
|
|||||||
public bool EnableUnderLine { get; set; }
|
public bool EnableUnderLine { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 启用数据库连接串加密策略
|
/// 启用数据库连接串加密策略(国密SM2加解密)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool EnableConnEncrypt { get; set; }
|
public bool EnableConnEncrypt { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,7 +73,7 @@ public static class SqlSugarSetup
|
|||||||
{
|
{
|
||||||
// 解密数据库连接串
|
// 解密数据库连接串
|
||||||
if (config.DbSettings.EnableConnEncrypt)
|
if (config.DbSettings.EnableConnEncrypt)
|
||||||
config.ConnectionString = CryptogramUtil.Decrypt(config.ConnectionString);
|
config.ConnectionString = CryptogramUtil.SM2Decrypt(config.ConnectionString);
|
||||||
|
|
||||||
// SqlFunc 扩展函数
|
// SqlFunc 扩展函数
|
||||||
var sqlFuncServices = new List<SqlFuncExternal>
|
var sqlFuncServices = new List<SqlFuncExternal>
|
||||||
|
|||||||
@ -525,7 +525,7 @@ public static class CommonUtil
|
|||||||
var ipInfo = IpTool.SearchWithI18N(ip); // 国际化查询,默认中文 中文zh-CN、英文en
|
var ipInfo = IpTool.SearchWithI18N(ip); // 国际化查询,默认中文 中文zh-CN、英文en
|
||||||
var addressList = new List<string>() { ipInfo.Country, ipInfo.Province, ipInfo.City, ipInfo.NetworkOperator };
|
var addressList = new List<string>() { ipInfo.Country, ipInfo.Province, ipInfo.City, ipInfo.NetworkOperator };
|
||||||
var location = string.Join(" ", addressList.Where(u => u != "0" && !string.IsNullOrWhiteSpace(u)).ToList()); // 去掉0及空并用空格连接
|
var location = string.Join(" ", addressList.Where(u => u != "0" && !string.IsNullOrWhiteSpace(u)).ToList()); // 去掉0及空并用空格连接
|
||||||
if (string.IsNullOrWhiteSpace(location)) location = "本地";
|
if (string.IsNullOrWhiteSpace(location)) location = "未知";
|
||||||
return (location, ipInfo.Longitude, ipInfo.Latitude);
|
return (location, ipInfo.Longitude, ipInfo.Latitude);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user