diff --git a/ZR.Admin.WebApi/Controllers/CodeGeneratorController.cs b/ZR.Admin.WebApi/Controllers/CodeGeneratorController.cs index cb778a8..e503f8e 100644 --- a/ZR.Admin.WebApi/Controllers/CodeGeneratorController.cs +++ b/ZR.Admin.WebApi/Controllers/CodeGeneratorController.cs @@ -90,8 +90,11 @@ namespace ZR.Admin.WebApi.Controllers var genTableInfo = GenTableService.GetGenTableInfo(dto.TableId); genTableInfo.Columns = GenTableColumnService.GenTableColumns(dto.TableId); - Dictionary options = JsonConvert.DeserializeObject>(genTableInfo.Options); - dto.ParentMenuId = (long)options.GetValueOrDefault("parentMenuId", 0); + if (!string.IsNullOrEmpty(genTableInfo.Options)) + { + Dictionary options = JsonConvert.DeserializeObject>(genTableInfo.Options); + dto.ParentMenuId = (long)options.GetValueOrDefault("parentMenuId", 0); + } dto.GenTable = genTableInfo; //็”Ÿๆˆไปฃ็  CodeGeneratorTool.Generate(genTableInfo, dto); @@ -176,9 +179,9 @@ namespace ZR.Admin.WebApi.Controllers ClassName = CodeGeneratorTool.GetClassName(tableName), BusinessName = CodeGeneratorTool.GetClassName(tableName), FunctionAuthor = ConfigUtils.Instance.GetConfig(GenConstants.Gen_author), - FunctionName = tabInfo.Description, + FunctionName = string.IsNullOrEmpty(tabInfo.Description) ? tableName : tabInfo.Description, TableName = tableName, - TableComment = tabInfo.Description, + TableComment = string.IsNullOrEmpty(tabInfo.Description) ? tableName : tabInfo.Description, Create_by = userName, }; genTable.TableId = GenTableService.ImportGenTable(genTable);