From da371ee5f2e4a256fac7e1edd62d8f51bcd03f55 Mon Sep 17 00:00:00 2001 From: tsf <460834639@qq.com> Date: Thu, 25 Apr 2024 16:13:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/config.php | 2 +- application/route.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/application/config.php b/application/config.php index 25d573c..53fc153 100644 --- a/application/config.php +++ b/application/config.php @@ -95,7 +95,7 @@ return [ // 是否开启路由解析缓存 'route_check_cache' => false, // 是否强制使用路由 - 'url_route_must' => false, + 'url_route_must' => true, // 域名部署 'url_domain_deploy' => false, // 域名根,如thinkphp.cn diff --git a/application/route.php b/application/route.php index 289b1e6..efae612 100644 --- a/application/route.php +++ b/application/route.php @@ -13,7 +13,7 @@ use think\Route; // ################################################################下载################################################################ // ################################################################下载################################################################ -Route::get('/download', 'admin/download/demo'); +Route::get('download', 'admin/download/demo'); // ################################################################管理后台################################################################ // ################################################################管理后台################################################################ @@ -34,8 +34,8 @@ Route::get('/download', 'admin/download/demo'); // ################################################################APP接口################################################################ // ################################################################APP接口################################################################ -// // 处理404错误 z -// Route::miss(function(){ -// return '404 Not Found'; -// // 或者你可以重定向到一个错误页面,或者进行其他处理 -// }); +// 处理404错误 z +Route::miss(function(){ + return '404 Not Found'; + // 或者你可以重定向到一个错误页面,或者进行其他处理 +});