diff --git a/app/admin/route/demo.php b/app/admin/route/demo.php index a5987eb62..a94e673ef 100644 --- a/app/admin/route/demo.php +++ b/app/admin/route/demo.php @@ -15,10 +15,11 @@ // +---------------------------------------------------------------------- use think\admin\service\SystemService; +use think\App; -invoke(function (\think\App $app) { +invoke(function (App $app) { /*! 非开发环境,清理限制文件 */ - if (!SystemService::instance()->checkRunMode('dev')) { + if ($app->request->isGet() && !SystemService::instance()->checkRunMode()) { @unlink("{$app->getBasePath()}admin/controller/api/Update.php"); @unlink("{$app->getBasePath()}admin/route/demo.php"); @rmdir("{$app->getBasePath()}admin/route");