From 87aa1dcafec06d8ae9c50eccbbb0781bbc63748a Mon Sep 17 00:00:00 2001
From: zhuangkaixing <1020526528@qq.com>
Date: Tue, 5 May 2020 10:56:56 +0800
Subject: [PATCH] 修复 crud 生成的 js 缺少导入连接,控制器缺少导入方法

---
 application/admin/command/Crud/stubs/controller.stub | 7 ++++++-
 application/admin/command/Crud/stubs/javascript.stub | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/application/admin/command/Crud/stubs/controller.stub b/application/admin/command/Crud/stubs/controller.stub
index 70b07a1..72a268e 100644
--- a/application/admin/command/Crud/stubs/controller.stub
+++ b/application/admin/command/Crud/stubs/controller.stub
@@ -24,7 +24,12 @@ class {%controllerName%} extends Backend
         $this->model = new \{%modelNamespace%}\{%modelName%};
 {%controllerAssignList%}
     }
-    
+
+    public function import()
+    {
+        parent::import();
+    }
+
     /**
      * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
      * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
diff --git a/application/admin/command/Crud/stubs/javascript.stub b/application/admin/command/Crud/stubs/javascript.stub
index 933cfa3..4774dff 100644
--- a/application/admin/command/Crud/stubs/javascript.stub
+++ b/application/admin/command/Crud/stubs/javascript.stub
@@ -10,6 +10,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     edit_url: '{%controllerUrl%}/edit',
                     del_url: '{%controllerUrl%}/del',
                     multi_url: '{%controllerUrl%}/multi',
+                    import_url: '{%controllerUrl%}/import',
                     table: '{%table%}',
                 }
             });
--
libgit2 0.24.0