From f8b55cdc682ffcf90364d30f82dc8683673f0de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Thu, 9 Feb 2023 14:51:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=9B=B4=E6=96=B0=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/Service.php | 3 +- app/admin/controller/Auth.php | 3 +- app/admin/controller/Base.php | 3 +- app/admin/controller/Config.php | 3 +- app/admin/controller/File.php | 3 +- app/admin/controller/Index.php | 3 +- app/admin/controller/Login.php | 3 +- app/admin/controller/Menu.php | 3 +- app/admin/controller/Oplog.php | 3 +- app/admin/controller/Queue.php | 3 +- app/admin/controller/User.php | 3 +- app/admin/controller/api/Plugs.php | 3 +- app/admin/controller/api/Queue.php | 3 +- app/admin/controller/api/System.php | 3 +- app/admin/controller/api/Upload.php | 3 +- app/admin/route/demo.php | 52 +++++++++++++++++++ .../20221013031925_install_admin.php | 3 +- .../20221013031926_install_admin_data.php | 7 ++- license | 2 +- 19 files changed, 90 insertions(+), 19 deletions(-) create mode 100644 app/admin/route/demo.php diff --git a/app/admin/Service.php b/app/admin/Service.php index e604a8a2e..9556fb79f 100644 --- a/app/admin/Service.php +++ b/app/admin/Service.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- namespace app\admin; diff --git a/app/admin/controller/Auth.php b/app/admin/controller/Auth.php index a5b60ed6b..21090442c 100644 --- a/app/admin/controller/Auth.php +++ b/app/admin/controller/Auth.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- namespace app\admin\controller; diff --git a/app/admin/controller/Base.php b/app/admin/controller/Base.php index 5083e6438..c9f55e9d1 100644 --- a/app/admin/controller/Base.php +++ b/app/admin/controller/Base.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- namespace app\admin\controller; diff --git a/app/admin/controller/Config.php b/app/admin/controller/Config.php index 77add0995..7cb5f1df6 100644 --- a/app/admin/controller/Config.php +++ b/app/admin/controller/Config.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- namespace app\admin\controller; diff --git a/app/admin/controller/File.php b/app/admin/controller/File.php index 05a3414a4..3aaefe325 100644 --- a/app/admin/controller/File.php +++ b/app/admin/controller/File.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- namespace app\admin\controller; diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index 4fb485a24..0a2e17cc6 100644 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- namespace app\admin\controller; diff --git a/app/admin/controller/Login.php b/app/admin/controller/Login.php index bcadc3c95..343ccc38c 100644 --- a/app/admin/controller/Login.php +++ b/app/admin/controller/Login.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- namespace app\admin\controller; diff --git a/app/admin/controller/Menu.php b/app/admin/controller/Menu.php index f4a3cc6c4..70a12d627 100644 --- a/app/admin/controller/Menu.php +++ b/app/admin/controller/Menu.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- namespace app\admin\controller; diff --git a/app/admin/controller/Oplog.php b/app/admin/controller/Oplog.php index ffd223a41..c37074144 100644 --- a/app/admin/controller/Oplog.php +++ b/app/admin/controller/Oplog.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- namespace app\admin\controller; diff --git a/app/admin/controller/Queue.php b/app/admin/controller/Queue.php index b2c0d6a4b..e2ecaaa88 100644 --- a/app/admin/controller/Queue.php +++ b/app/admin/controller/Queue.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- namespace app\admin\controller; diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index 40a70d5d0..ad39bb4b0 100644 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- namespace app\admin\controller; diff --git a/app/admin/controller/api/Plugs.php b/app/admin/controller/api/Plugs.php index dd27ce105..110d7d09b 100644 --- a/app/admin/controller/api/Plugs.php +++ b/app/admin/controller/api/Plugs.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- namespace app\admin\controller\api; diff --git a/app/admin/controller/api/Queue.php b/app/admin/controller/api/Queue.php index 34b774918..2c96c7907 100644 --- a/app/admin/controller/api/Queue.php +++ b/app/admin/controller/api/Queue.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- namespace app\admin\controller\api; diff --git a/app/admin/controller/api/System.php b/app/admin/controller/api/System.php index ea0eabb33..32894ece4 100644 --- a/app/admin/controller/api/System.php +++ b/app/admin/controller/api/System.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- namespace app\admin\controller\api; diff --git a/app/admin/controller/api/Upload.php b/app/admin/controller/api/Upload.php index 964689b29..61638accc 100644 --- a/app/admin/controller/api/Upload.php +++ b/app/admin/controller/api/Upload.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- namespace app\admin\controller\api; diff --git a/app/admin/route/demo.php b/app/admin/route/demo.php new file mode 100644 index 000000000..d39292f51 --- /dev/null +++ b/app/admin/route/demo.php @@ -0,0 +1,52 @@ + +// +---------------------------------------------------------------------- +// | 官方网站: https://thinkadmin.top +// +---------------------------------------------------------------------- +// | 开源协议 ( https://mit-license.org ) +// | 免费声明 ( https://thinkadmin.top/disclaimer ) +// +---------------------------------------------------------------------- +// | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin +// +---------------------------------------------------------------------- + +use think\admin\Library; +use think\admin\service\RuntimeService; + +/*! 演示环境禁止操作路由绑定 */ +if (RuntimeService::check('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/database/migrations/20221013031925_install_admin.php b/database/migrations/20221013031925_install_admin.php index a94cb1f4e..716766ead 100644 --- a/database/migrations/20221013031925_install_admin.php +++ b/database/migrations/20221013031925_install_admin.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- use think\migration\Migrator; diff --git a/database/migrations/20221013031926_install_admin_data.php b/database/migrations/20221013031926_install_admin_data.php index 3aa5485fa..03fbda6dd 100644 --- a/database/migrations/20221013031926_install_admin_data.php +++ b/database/migrations/20221013031926_install_admin_data.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | Admin Plugin for ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2023 Anyon +// | 版权所有 2014~2023 Anyon // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -11,6 +11,7 @@ // | 免费声明 ( https://thinkadmin.top/disclaimer ) // +---------------------------------------------------------------------- // | gitee 代码仓库:https://gitee.com/zoujingli/think-plugs-admin +// | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- use think\admin\extend\PhinxExtend; @@ -93,7 +94,9 @@ class InstallAdminData extends Migrator ], ], ], - ], ['node' => 'admin/config/index']); + ], [ + 'url|node' => 'admin/config/index' + ]); } /** diff --git a/license b/license index 867758ab8..8e2f3d7ae 100644 --- a/license +++ b/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 邹景立 +Copyright (c) 2020~2023 邹景立 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal