优化代码生成

This commit is contained in:
不做码农 2023-11-29 20:05:39 +08:00
parent eef8962974
commit 3337b9abb3
2 changed files with 12 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}