diff --git a/ZR.Admin.WebApi/Controllers/System/CodeGeneratorController.cs b/ZR.Admin.WebApi/Controllers/System/CodeGeneratorController.cs index 8b83cad..ca047ae 100644 --- a/ZR.Admin.WebApi/Controllers/System/CodeGeneratorController.cs +++ b/ZR.Admin.WebApi/Controllers/System/CodeGeneratorController.cs @@ -256,8 +256,18 @@ namespace ZR.Admin.WebApi.Controllers if (genTableInfo.GenType == "1") { var genPath = genTableInfo.GenPath; + string parentPath; string tempPath = WebHostEnvironment.ContentRootPath; - var parentPath = tempPath[..tempPath.LastIndexOf(@"\")]; + + if (ComputerHelper.IsUnix()) + { + parentPath = Path.Combine(WebHostEnvironment.WebRootPath, "Generatecode"); + } + else + { + parentPath = tempPath[..tempPath.LastIndexOf(@"\")]; + } + Console.WriteLine("代码生成路径" + parentPath); //代码生成文件夹路径 dto.GenCodePath = (genPath.IsEmpty() || genPath.Equals("/")) ? parentPath : genTableInfo.GenPath; } diff --git a/ZR.CodeGenerator/CodeGeneratorTool.cs b/ZR.CodeGenerator/CodeGeneratorTool.cs index 8a28cfa..d4ca473 100644 --- a/ZR.CodeGenerator/CodeGeneratorTool.cs +++ b/ZR.CodeGenerator/CodeGeneratorTool.cs @@ -447,7 +447,7 @@ namespace ZR.CodeGenerator CheckedBtn = new int[] { 1, 2, 3 } } }; - genTable.Options.PermissionPrefix = $"{genTable.ModuleName.ToLower()}:{genTable.ClassName.ToLower()}";//权限 + genTable.Options.PermissionPrefix = $"{genTable.ClassName.ToLower()}";//权限 return genTable; }