😎1、获取缓存值若Key经过URL编码则进行解码 2、优化枚举转字典 3、升级npm包依赖

This commit is contained in:
zuohuaijun 2024-07-12 23:08:47 +08:00
parent 28a0204924
commit af2fd572d5
4 changed files with 18 additions and 9 deletions

View File

@ -70,7 +70,7 @@ public class EnumToDictJob : IJob
}); });
try try
{ {
db.Ado.BeginTran(); db.BeginTran();
if (uSysDictType.Count > 0) if (uSysDictType.Count > 0)
await db.Updateable(uSysDictType).ExecuteCommandAsync(stoppingToken); await db.Updateable(uSysDictType).ExecuteCommandAsync(stoppingToken);
@ -78,11 +78,11 @@ public class EnumToDictJob : IJob
if (uSysDictData.Count > 0) if (uSysDictData.Count > 0)
await db.Updateable(uSysDictData).ExecuteCommandAsync(stoppingToken); await db.Updateable(uSysDictData).ExecuteCommandAsync(stoppingToken);
db.Ado.CommitTran(); db.CommitTran();
} }
catch (Exception error) catch (Exception error)
{ {
db.Ado.RollbackTran(); db.RollbackTran();
Log.Error($"{context.Trigger.Description}更新枚举转换字典入库错误:" + _jsonSerializer.Serialize(error)); Log.Error($"{context.Trigger.Description}更新枚举转换字典入库错误:" + _jsonSerializer.Serialize(error));
throw new Exception($"{context.Trigger.Description}更新枚举转换字典入库错误"); throw new Exception($"{context.Trigger.Description}更新枚举转换字典入库错误");
} }
@ -123,7 +123,7 @@ public class EnumToDictJob : IJob
}); });
try try
{ {
db.Ado.BeginTran(); db.BeginTran();
if (iDictType.Count > 0) if (iDictType.Count > 0)
await db.Insertable(iDictType).ExecuteCommandAsync(stoppingToken); await db.Insertable(iDictType).ExecuteCommandAsync(stoppingToken);
@ -131,11 +131,11 @@ public class EnumToDictJob : IJob
if (iDictData.Count > 0) if (iDictData.Count > 0)
await db.Insertable(iDictData).ExecuteCommandAsync(stoppingToken); await db.Insertable(iDictData).ExecuteCommandAsync(stoppingToken);
db.Ado.CommitTran(); db.CommitTran();
} }
catch (Exception error) catch (Exception error)
{ {
db.Ado.RollbackTran(); db.RollbackTran();
Log.Error($"{context.Trigger.Description}新增枚举转换字典入库错误:" + _jsonSerializer.Serialize(error)); Log.Error($"{context.Trigger.Description}新增枚举转换字典入库错误:" + _jsonSerializer.Serialize(error));
throw new Exception($"{context.Trigger.Description}新增枚举转换字典入库错误"); throw new Exception($"{context.Trigger.Description}新增枚举转换字典入库错误");
} }

View File

@ -144,6 +144,10 @@ public class SysCacheService : IDynamicApiController, ISingleton
[DisplayName("获取缓存值")] [DisplayName("获取缓存值")]
public object GetValue(string key) public object GetValue(string key)
{ {
// 若Key经过URL编码则进行解码
if (Regex.IsMatch(key, @"%[0-9a-fA-F]{2}"))
key = HttpUtility.UrlDecode(key);
return _cacheProvider.Cache == Cache.Default return _cacheProvider.Cache == Cache.Default
? _cacheProvider.Cache.Get<object>($"{_cacheOptions.Prefix}{key}") ? _cacheProvider.Cache.Get<object>($"{_cacheOptions.Prefix}{key}")
: _cacheProvider.Cache.Get<string>($"{_cacheOptions.Prefix}{key}"); : _cacheProvider.Cache.Get<string>($"{_cacheOptions.Prefix}{key}");

View File

@ -31,7 +31,7 @@
"echarts": "^5.5.1", "echarts": "^5.5.1",
"echarts-gl": "^2.0.9", "echarts-gl": "^2.0.9",
"echarts-wordcloud": "^2.1.0", "echarts-wordcloud": "^2.1.0",
"element-plus": "^2.7.6", "element-plus": "^2.7.7",
"exceljs": "^4.4.0", "exceljs": "^4.4.0",
"ezuikit": "^1.0.0", "ezuikit": "^1.0.0",
"ezuikit-js": "^8.0.5", "ezuikit-js": "^8.0.5",
@ -68,8 +68,8 @@
"vue-signature-pad": "^3.0.2", "vue-signature-pad": "^3.0.2",
"vue3-tree-org": "^4.2.2", "vue3-tree-org": "^4.2.2",
"vuedraggable": "4.0.3", "vuedraggable": "4.0.3",
"vxe-pc-ui": "^4.0.61", "vxe-pc-ui": "^4.0.64",
"vxe-table": "^4.7.48", "vxe-table": "^4.7.49",
"vxe-table-plugin-element": "^4.0.4", "vxe-table-plugin-element": "^4.0.4",
"vxe-table-plugin-export-xlsx": "^4.0.5", "vxe-table-plugin-export-xlsx": "^4.0.5",
"xe-utils": "^3.5.28", "xe-utils": "^3.5.28",

View File

@ -104,4 +104,9 @@ export const dataTypeList = [
hasLength: false, hasLength: false,
hasDecimalDigits: false, hasDecimalDigits: false,
}, },
{
value: 'boolean',
hasLength: false,
hasDecimalDigits: false,
},
]; ];