mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
修复了已知的bug
This commit is contained in:
@@ -257,7 +257,16 @@ namespace Serein.Library.Utils
|
||||
object result;
|
||||
if (type.IsEnum)
|
||||
{
|
||||
result = Enum.Parse(type, valueStr);
|
||||
if (int.TryParse(valueStr, out int numericValue))
|
||||
{
|
||||
// 输入是数字,直接转换
|
||||
result = Enum.ToObject(type, numericValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 输入是枚举名称
|
||||
result = Enum.Parse(type, valueStr, ignoreCase: true);
|
||||
}
|
||||
}
|
||||
else if (type == typeof(bool))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user