From 80b5e1724d8094ed774f4a060ccec08c012975d9 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 26 Mar 2024 11:40:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Index.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/api/controller/Index.php b/app/api/controller/Index.php index 93dde3d..60ec358 100644 --- a/app/api/controller/Index.php +++ b/app/api/controller/Index.php @@ -15,9 +15,17 @@ use app\api\BaseController; use think\facade\Db; use app\project\validate\TaskCheck; use think\exception\ValidateException; +use app\api\middleware\Auth; class Index extends BaseController { + /** + * 控制器中间件 [登录、注册 不需要鉴权] + * @var array + */ + protected $middleware = [ + Auth::class => ['except' => ['task_add'] ] + ]; //上传文件 public function upload() {