From b24e68b834ed4ba7657065fca97f6d4c106dd71f Mon Sep 17 00:00:00 2001 From: topnuomi <1130395124@qq.com> Date: Sun, 4 Oct 2020 21:06:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A8=A1=E5=9D=97=E6=A3=80?= =?UTF-8?q?=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/library/Router.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/framework/library/Router.php b/framework/library/Router.php index 6af800f..1a3543a 100644 --- a/framework/library/Router.php +++ b/framework/library/Router.php @@ -307,6 +307,11 @@ class Router */ public function handler($uri) { + // 检查模块是否存在 + if (!is_dir(APP_PATH . BIND_MODULE)) { + throw new RouteException('不存在的模块:' . BIND_MODULE); + } + // 如果为空则默认为/ $uri = $uri ? $uri : '/'; $defaultMethod = config('default_method'); $requestMethod = strtolower($this->request->requestMethod());