From 3337b9abb30feb9e9113cfae4bc3fbe6328e21cc 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: Wed, 29 Nov 2023 20:05:39 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/System/CodeGeneratorController.cs | 12 +++++++++++- ZR.CodeGenerator/CodeGeneratorTool.cs | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) 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; }