From eaabc93b4708f4db0d89709cc270e24aab0682d1 Mon Sep 17 00:00:00 2001 From: Anyon Date: Mon, 2 Dec 2019 17:39:42 +0800 Subject: [PATCH] ComposerUpdate --- app/admin/controller/Auth.php | 3 +-- app/admin/controller/Index.php | 6 +++--- app/admin/controller/Menu.php | 3 ++- composer.lock | 8 ++++---- vendor/composer/installed.json | 8 ++++---- vendor/services.php | 2 +- .../think-library/src/service/AdminService.php | 10 ++++++++++ 7 files changed, 25 insertions(+), 15 deletions(-) diff --git a/app/admin/controller/Auth.php b/app/admin/controller/Auth.php index d513fc2e7..dc8bc8f92 100644 --- a/app/admin/controller/Auth.php +++ b/app/admin/controller/Auth.php @@ -98,9 +98,8 @@ class Auth extends Controller $map = ['auth' => input('id', '0')]; $action = strtolower(input('action', '')); if ($action === 'get') { - $this->app->cache->delete('system_auth_node'); $checkeds = $this->app->db->name('SystemAuthNode')->where($map)->column('node'); - $this->success('获取权限节点成功!', AdminService::instance()->getTree($checkeds)); + $this->success('获取权限节点成功!', AdminService::instance()->clearCache()->getTree($checkeds)); } elseif ($action === 'save') { list($post, $data) = [$this->request->post(), []]; foreach (isset($post['nodes']) ? $post['nodes'] : [] as $node) { diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index 1b2408298..af2252b45 100644 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -37,12 +37,12 @@ class Index extends Controller */ public function index() { - $this->title = '系统管理后台'; - $login = AdminService::instance()->apply(true)->isLogin(); + $this->login = AdminService::instance()->apply(true)->isLogin(); $this->menus = MenuService::instance()->getTree(); - if (empty($this->menus) && empty($login)) { + if (empty($this->menus) && empty($this->login)) { $this->redirect(url('@admin/login')); } else { + $this->title = '系统管理后台'; $this->fetch(); } } diff --git a/app/admin/controller/Menu.php b/app/admin/controller/Menu.php index fef5e8b62..2b26f1afb 100644 --- a/app/admin/controller/Menu.php +++ b/app/admin/controller/Menu.php @@ -17,6 +17,7 @@ namespace app\admin\controller; use think\admin\Controller; use think\admin\extend\DataExtend; +use think\admin\service\AdminService; use think\admin\service\MenuService; /** @@ -97,7 +98,7 @@ class Menu extends Controller { if ($this->request->isGet()) { // 清理权限节点 - $this->app->cache->delete('system_auth_node'); + AdminService::instance()->clearCache(); // 读取系统功能节点 $this->nodes = MenuService::instance()->getList(); // 选择自己的上级菜单 diff --git a/composer.lock b/composer.lock index 7335e5c0c..8d5c68928 100644 --- a/composer.lock +++ b/composer.lock @@ -783,12 +783,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "913a6ed13c84bad23c698dd404c5c16418055670" + "reference": "d14437d0ac14aa52fa7627ec99155d90c0b51c6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/913a6ed13c84bad23c698dd404c5c16418055670", - "reference": "913a6ed13c84bad23c698dd404c5c16418055670", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/d14437d0ac14aa52fa7627ec99155d90c0b51c6e", + "reference": "d14437d0ac14aa52fa7627ec99155d90c0b51c6e", "shasum": "", "mirrors": [ { @@ -832,7 +832,7 @@ ], "description": "ThinkPHP v6.0 Development Library", "homepage": "http://framework.thinkadmin.top", - "time": "2019-12-02T08:59:43+00:00" + "time": "2019-12-02T09:26:38+00:00" } ], "packages-dev": [], diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index ce06a3358..db6a853d3 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -805,12 +805,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "913a6ed13c84bad23c698dd404c5c16418055670" + "reference": "d14437d0ac14aa52fa7627ec99155d90c0b51c6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/913a6ed13c84bad23c698dd404c5c16418055670", - "reference": "913a6ed13c84bad23c698dd404c5c16418055670", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/d14437d0ac14aa52fa7627ec99155d90c0b51c6e", + "reference": "d14437d0ac14aa52fa7627ec99155d90c0b51c6e", "shasum": "", "mirrors": [ { @@ -826,7 +826,7 @@ "ext-json": "*", "topthink/framework": "^6.0" }, - "time": "2019-12-02T08:59:43+00:00", + "time": "2019-12-02T09:26:38+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index 01b89ffca..927158b34 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\app\\Service', diff --git a/vendor/zoujingli/think-library/src/service/AdminService.php b/vendor/zoujingli/think-library/src/service/AdminService.php index f562ec53c..8567ac795 100644 --- a/vendor/zoujingli/think-library/src/service/AdminService.php +++ b/vendor/zoujingli/think-library/src/service/AdminService.php @@ -108,4 +108,14 @@ class AdminService extends Service return $this; } + /** + * 清理节点缓存 + * @return $this + */ + public function clearCache() + { + $this->app->cache->delete('system_auth_node'); + return $this; + } + } \ No newline at end of file