From e985633d53f0972fc0469b821c39b5725fa0f475 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, 26 May 2022 13:32:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E8=B7=AF=E5=BE=84=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/appsettings.json | 5 +++-- ZR.CodeGenerator/CodeGeneratorTool.cs | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ZR.Admin.WebApi/appsettings.json b/ZR.Admin.WebApi/appsettings.json index d9f765b1..d4c987ba 100644 --- a/ZR.Admin.WebApi/appsettings.json +++ b/ZR.Admin.WebApi/appsettings.json @@ -34,8 +34,9 @@ "conn": "server=LAPTOP-STKF2M8H\\SQLEXPRESS;user=zr;pwd=abc;database=ZrAdmin;Trusted_Connection=SSPI", "dbType": 1, //MySql = 0, SqlServer = 1 "autoPre": true, //自动去除表前缀 - "author": "zr", - "tablePrefix": "sys_" //"表前缀(生成类名不会包含表前缀,多个用逗号分隔)", + "author": "admin", + "tablePrefix": "sys_", //"表前缀(生成类名不会包含表前缀,多个用逗号分隔)", + "vuePath": "" //前端代码存储路径eg:D:\Work\ZRAdmin-Vue3 }, //邮箱配置信息 "MailOptions": { diff --git a/ZR.CodeGenerator/CodeGeneratorTool.cs b/ZR.CodeGenerator/CodeGeneratorTool.cs index 11989046..f65de042 100644 --- a/ZR.CodeGenerator/CodeGeneratorTool.cs +++ b/ZR.CodeGenerator/CodeGeneratorTool.cs @@ -38,8 +38,12 @@ namespace ZR.CodeGenerator _option.ServicesNamespace = _option.BaseNamespace + "Service"; _option.ApiControllerNamespace = _option.BaseNamespace + "Admin.WebApi"; + var vuePath = AppSettings.GetConfig("gen:vuePath"); dto.VueParentPath = dto.VueVersion == 3 ? "ZRAdmin-vue" : "ZR.Vue"; - + if (!vuePath.IsEmpty()) + { + dto.VueParentPath = vuePath; + } dto.GenOptions = _option; string PKName = "Id";