From cb28c5b2b0d21b7edb2e8d86fc1f88ab261af2e6 Mon Sep 17 00:00:00 2001 From: yxh Date: Fri, 3 Sep 2021 16:47:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E8=B7=AF=E5=BE=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/system/service/tools_gen_table.go | 4 ++++ template/vm/go/controller.template | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/system/service/tools_gen_table.go b/app/system/service/tools_gen_table.go index 8e3c164..501cd51 100644 --- a/app/system/service/tools_gen_table.go +++ b/app/system/service/tools_gen_table.go @@ -426,6 +426,10 @@ func (s *toolsGenTable) GenCode(ids []int, ctx context.Context) (err error) { return gerror.New("获取本地路径失败") } frontDir := g.Cfg().GetString("gen.frontDir") + if !gfile.IsDir(frontDir) { + err = gerror.New("项目前端路径不存在,请检查是否已在配置文件中配置!") + return + } for _, id := range ids { var genData g.MapStrStr var extendData *dao.ToolsGenTableExtend diff --git a/template/vm/go/controller.template b/template/vm/go/controller.template index dfbdbdb..e3d8bbb 100644 --- a/template/vm/go/controller.template +++ b/template/vm/go/controller.template @@ -172,7 +172,7 @@ func (c *{{$structName}}) Delete(r *ghttp.Request) { {{range $index,$column:= .table.Columns}} {{if and (HasSuffix $column.ColumnName "status") (eq $column.IsList "1") }} // Change{{$column.GoField}} 修改状态 -func (c *{{$structName}})Change{{$column.GoField}}(r *ghttp.Request){ +func (c *{{$structName}}) Change{{$column.GoField}}(r *ghttp.Request){ var req *dao.{{$.table.ClassName}}{{$column.GoField}}Req //获取参数 if err := r.Parse(&req); err != nil {