diff --git a/app/admin/controller/Auth.php b/app/admin/controller/Auth.php index df10c6e49..6bbac8330 100644 --- a/app/admin/controller/Auth.php +++ b/app/admin/controller/Auth.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- diff --git a/app/admin/controller/Base.php b/app/admin/controller/Base.php index eaea613bb..a95bf3f0a 100644 --- a/app/admin/controller/Base.php +++ b/app/admin/controller/Base.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- diff --git a/app/admin/controller/Config.php b/app/admin/controller/Config.php index 272a4e829..58787b3a9 100644 --- a/app/admin/controller/Config.php +++ b/app/admin/controller/Config.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -33,6 +33,14 @@ use think\admin\storage\TxcosStorage; */ class Config extends Controller { + const themes = [ + 'default' => '默认色', + 'red' => '玫瑰红', + 'blue' => '天空蓝', + 'black' => '精典黑', + 'white' => '简约白' + ]; + /** * 系统参数配置 * @auth true @@ -41,7 +49,7 @@ class Config extends Controller public function index() { $this->title = '系统参数配置'; - $this->isSuper = AdminService::instance()->isSuper(); + $this->super = AdminService::instance()->isSuper(); $this->version = ModuleService::instance()->getVersion(); $this->fetch(); } @@ -58,6 +66,7 @@ class Config extends Controller $this->_applyFormToken(); if ($this->request->isGet()) { $this->title = '修改系统参数'; + $this->themes = static::themes; $this->fetch(); } else { $post = $this->request->post(); @@ -81,7 +90,7 @@ class Config extends Controller } if (!empty($info) && !empty($info['file'])) { $favicon = new FaviconExtend($info['file']); - $favicon->saveIco($this->app->getRootPath() . 'public/favicon.ico'); + $favicon->saveIco("{$this->app->getRootPath()}public/favicon.ico"); } } catch (\Exception $exception) { trace_file($exception); diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index 2b8bd28ca..81aa35799 100644 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -28,7 +28,6 @@ use think\admin\service\MenuService; */ class Index extends Controller { - /** * 显示后台首页 * @throws \ReflectionException @@ -39,6 +38,7 @@ class Index extends Controller public function index() { /*! 根据运行模式刷新权限 */ + $debug = $this->app->isDebug(); AdminService::instance()->apply($debug); /*! 读取当前用户权限菜单树 */ @@ -50,12 +50,36 @@ class Index extends Controller $this->redirect(sysuri('admin/login/index')); } else { $this->title = '系统管理后台'; - $this->isSuper = AdminService::instance()->isSuper(); - $this->theme = sysconf('base.site_theme') ?: 'default'; + $this->super = AdminService::instance()->isSuper(); + $this->theme = AdminService::instance()->getUserTheme(); $this->fetch('layout'); } } + /** + * 后台主题切换 + * @login true + * @return void + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function theme() + { + if ($this->request->isGet()) { + $this->theme = AdminService::instance()->getUserTheme(); + $this->themes = Config::themes; + $this->fetch(); + } else { + $data = $this->_vali(['site_theme.require' => '主题名称不能为空!']); + if (AdminService::instance()->setUserTheme($data['site_theme'])) { + $this->success('主题配置保存成功!'); + } else { + $this->error('主题配置保存失败!'); + } + } + } + /** * 修改用户资料 * @login true diff --git a/app/admin/controller/Login.php b/app/admin/controller/Login.php index 2f3b8fecc..e6cfcbcf1 100644 --- a/app/admin/controller/Login.php +++ b/app/admin/controller/Login.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- diff --git a/app/admin/controller/Menu.php b/app/admin/controller/Menu.php index a075f6406..06c801c77 100644 --- a/app/admin/controller/Menu.php +++ b/app/admin/controller/Menu.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- diff --git a/app/admin/controller/Module.php b/app/admin/controller/Module.php index 0fbc9b7ae..ec8d769fe 100644 --- a/app/admin/controller/Module.php +++ b/app/admin/controller/Module.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- diff --git a/app/admin/controller/Oplog.php b/app/admin/controller/Oplog.php index 5fe9d1c08..e9f84153c 100644 --- a/app/admin/controller/Oplog.php +++ b/app/admin/controller/Oplog.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- diff --git a/app/admin/controller/Queue.php b/app/admin/controller/Queue.php index ac3e187dd..204ea1571 100644 --- a/app/admin/controller/Queue.php +++ b/app/admin/controller/Queue.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- @@ -46,7 +46,7 @@ class Queue extends Controller $this->title = '系统任务管理'; $this->iswin = ProcessService::instance()->iswin(); // 超级管理面板 - if ($this->isSuper = AdminService::instance()->isSuper()) { + if ($this->super = AdminService::instance()->isSuper()) { $process = ProcessService::instance(); if ($process->iswin() || empty($_SERVER['USER'])) { $this->command = $process->think('xadmin:queue start'); diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index 93dffa465..235f638d2 100644 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- diff --git a/app/admin/controller/api/Plugs.php b/app/admin/controller/api/Plugs.php index 27e59fd21..a7bd24dab 100644 --- a/app/admin/controller/api/Plugs.php +++ b/app/admin/controller/api/Plugs.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- diff --git a/app/admin/controller/api/Queue.php b/app/admin/controller/api/Queue.php index 83dbad010..6b7073b02 100644 --- a/app/admin/controller/api/Queue.php +++ b/app/admin/controller/api/Queue.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- diff --git a/app/admin/controller/api/Runtime.php b/app/admin/controller/api/Runtime.php index 6215b415f..4a19f8f09 100644 --- a/app/admin/controller/api/Runtime.php +++ b/app/admin/controller/api/Runtime.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- diff --git a/app/admin/controller/api/Update.php b/app/admin/controller/api/Update.php index 80ccb28c8..9092c8ad7 100644 --- a/app/admin/controller/api/Update.php +++ b/app/admin/controller/api/Update.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- diff --git a/app/admin/controller/api/Upload.php b/app/admin/controller/api/Upload.php index dc885d870..4c6801893 100644 --- a/app/admin/controller/api/Upload.php +++ b/app/admin/controller/api/Upload.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- diff --git a/app/admin/module/default.php b/app/admin/module/default.php index 969c2ac35..2bfe3a91e 100644 --- a/app/admin/module/default.php +++ b/app/admin/module/default.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- diff --git a/app/admin/route/demo.php b/app/admin/route/demo.php index 5911e6d59..cfc50437f 100644 --- a/app/admin/route/demo.php +++ b/app/admin/route/demo.php @@ -3,7 +3,7 @@ // +---------------------------------------------------------------------- // | ThinkAdmin // +---------------------------------------------------------------------- -// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ] +// | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ] // +---------------------------------------------------------------------- // | 官方网站: https://thinkadmin.top // +---------------------------------------------------------------------- diff --git a/app/admin/view/config/index.html b/app/admin/view/config/index.html index a7a6da0fd..9917d3851 100644 --- a/app/admin/view/config/index.html +++ b/app/admin/view/config/index.html @@ -1,7 +1,7 @@ {extend name="main"} {block name="button"} - + 清理无效配置 @@ -11,7 +11,7 @@ {/block} {block name="content"} - +
运行模式Run Mode diff --git a/app/admin/view/config/system.html b/app/admin/view/config/system.html index f09699aa4..8f6e89c91 100644 --- a/app/admin/view/config/system.html +++ b/app/admin/view/config/system.html @@ -1,43 +1,10 @@ -
+
-
-
登录背景图片Back Image
- - - - - - -
- - -
-
- -
-
-
后台登录入口Login Entry
- -
-
- -
-
- 后台登录入口由英文字母开头且不能有相同名称的模块,设置之后原地址不能继续访问 ~ -
-
- -
-
默认主题样式Theme Style
-
- {foreach ['default'=>'默认色','white'=>'简约白','black'=>'精典黑','red'=>'玫瑰红','blue'=>'天空蓝'] as $k=>$v} +
+
默认主题样式Theme Style
+
+ {foreach $themes as $k=>$v} {/foreach}
- 用户登录管理后台默认会以此配置的主题显示管理界面,用户也可以单独修改配置主题 ~ + 用户登录管理后台,未配置个性化主题的用户默认会使用此处配置的主题样式 ~
-
+
+
+ +
+
+
后台登录入口Login Entry
+ +
+
+ 后台登录入口是由英文字母开头,且不能有相同名称的模块,设置之后原地址不能继续访问,请谨慎配置 ~ +
+
+ +
+
登录背景图片Background Image
+
+ + +
+
+ +
浏览器小图标Browser Icon
-
-
+
+
-
+
-
+