完善 MCS 桌面代理与开炼机动作同步,修复原料相关菜单权限,桌面端新增上辅机 MES 菜单。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-27 15:56:05 +08:00
parent 7a9c19e4f3
commit 442a4c8ae2
113 changed files with 10169 additions and 91 deletions

View File

@@ -27,7 +27,37 @@ namespace YY.Admin.Services.Service.Config
_sysCacheService.Set($"{CacheConst.KeyConfig}{code}", value);
}
if (string.IsNullOrWhiteSpace(value)) return default;
return (T)Convert.ChangeType(value, typeof(T));
// boolConvert.ChangeType 对 "1"/"Y" 等会抛异常,统一稳健解析
var targetType = Nullable.GetUnderlyingType(typeof(T)) ?? typeof(T);
if (targetType == typeof(bool))
{
var b = ParseConfigBool(value);
return (T)(object)b;
}
return (T)Convert.ChangeType(value, targetType);
}
private static bool ParseConfigBool(string value)
{
if (bool.TryParse(value, out var b))
return b;
switch (value.Trim().ToLowerInvariant())
{
case "1":
case "y":
case "yes":
case "on":
return true;
case "0":
case "n":
case "no":
case "off":
return false;
default:
return false;
}
}
/// <inheritdoc />