From 0197c238ebf0138ad5cbe7850d20b4bff06c985e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Thu, 18 Nov 2021 10:10:04 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=94=9F=E6=88=90=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/CodeGeneratorController.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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);