diff --git a/app/admin/route/demo.php b/app/admin/route/demo.php index 6d4e300e7..3ccca9e20 100644 --- a/app/admin/route/demo.php +++ b/app/admin/route/demo.php @@ -14,48 +14,46 @@ // | github 代码仓库:https://github.com/zoujingli/ThinkAdmin // +---------------------------------------------------------------------- +use think\admin\Library; use think\admin\service\SystemService; -use think\App; -invoke(function (App $app) { - /*! 非开发环境,清理限制文件 */ - if ($app->request->isGet() && !SystemService::checkRunMode()) { - @unlink("{$app->getBasePath()}admin/controller/api/Update.php"); - @unlink("{$app->getBasePath()}admin/route/demo.php"); - @rmdir("{$app->getBasePath()}admin/route"); - return; - } - /*! 演示环境禁止操作路由绑定 */ - if (SystemService::checkRunMode('demo')) { - $app->route->post('index/pass', function () { - return json(['code' => 0, 'info' => '演示环境禁止修改用户密码!']); - }); - $app->route->post('config/system', function () { - return json(['code' => 0, 'info' => '演示环境禁止修改系统配置!']); - }); - $app->route->post('config/storage', function () { - return json(['code' => 0, 'info' => '演示环境禁止修改系统配置!']); - }); - $app->route->post('menu', function () { - return json(['code' => 0, 'info' => '演示环境禁止给菜单排序!']); - }); - $app->route->post('menu/index', function () { - return json(['code' => 0, 'info' => '演示环境禁止给菜单排序!']); - }); - $app->route->post('menu/add', function () { - return json(['code' => 0, 'info' => '演示环境禁止添加菜单!']); - }); - $app->route->post('menu/edit', function () { - return json(['code' => 0, 'info' => '演示环境禁止编辑菜单!']); - }); - $app->route->post('menu/state', function () { - return json(['code' => 0, 'info' => '演示环境禁止禁用菜单!']); - }); - $app->route->post('menu/remove', function () { - return json(['code' => 0, 'info' => '演示环境禁止删除菜单!']); - }); - $app->route->post('user/pass', function () { - return json(['code' => 0, 'info' => '演示环境禁止修改用户密码!']); - }); - } -}); \ No newline at end of file +/*! 非开发环境,清理限制文件 */ +if (Library::$sapp->request->isGet() && !SystemService::checkRunMode()) { + @unlink(Library::$sapp->getBasePath() . 'admin/controller/api/Update.php'); + @unlink(Library::$sapp->getBasePath() . 'admin/route/demo.php'); + @rmdir(Library::$sapp->getBasePath() . 'admin/route'); +} + +/*! 演示环境禁止操作路由绑定 */ +if (SystemService::checkRunMode('demo')) { + Library::$sapp->route->post('index/pass', function () { + return json(['code' => 0, 'info' => '演示环境禁止修改用户密码!']); + }); + Library::$sapp->route->post('config/system', function () { + return json(['code' => 0, 'info' => '演示环境禁止修改系统配置!']); + }); + Library::$sapp->route->post('config/storage', function () { + return json(['code' => 0, 'info' => '演示环境禁止修改系统配置!']); + }); + Library::$sapp->route->post('menu', function () { + return json(['code' => 0, 'info' => '演示环境禁止给菜单排序!']); + }); + Library::$sapp->route->post('menu/index', function () { + return json(['code' => 0, 'info' => '演示环境禁止给菜单排序!']); + }); + Library::$sapp->route->post('menu/add', function () { + return json(['code' => 0, 'info' => '演示环境禁止添加菜单!']); + }); + Library::$sapp->route->post('menu/edit', function () { + return json(['code' => 0, 'info' => '演示环境禁止编辑菜单!']); + }); + Library::$sapp->route->post('menu/state', function () { + return json(['code' => 0, 'info' => '演示环境禁止禁用菜单!']); + }); + Library::$sapp->route->post('menu/remove', function () { + return json(['code' => 0, 'info' => '演示环境禁止删除菜单!']); + }); + Library::$sapp->route->post('user/pass', function () { + return json(['code' => 0, 'info' => '演示环境禁止修改用户密码!']); + }); +} \ No newline at end of file diff --git a/app/admin/view/api/upload/image.html b/app/admin/view/api/upload/image.html index e35bf8fff..1d40b6caf 100644 --- a/app/admin/view/api/upload/image.html +++ b/app/admin/view/api/upload/image.html @@ -12,6 +12,7 @@
{{d.hash}}