ComposerUpdate

This commit is contained in:
Anyon 2019-12-02 17:39:42 +08:00
parent d47622328c
commit eaabc93b47
7 changed files with 25 additions and 15 deletions

View File

@ -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) {

View File

@ -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();
}
}

View File

@ -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();
// 选择自己的上级菜单

8
composer.lock generated
View File

@ -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": [],

View File

@ -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": {

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php
// This file is automatically generated at:2019-12-02 17:03:50
// This file is automatically generated at:2019-12-02 17:28:13
declare (strict_types = 1);
return array (
0 => 'think\\app\\Service',

View File

@ -108,4 +108,14 @@ class AdminService extends Service
return $this;
}
/**
* 清理节点缓存
* @return $this
*/
public function clearCache()
{
$this->app->cache->delete('system_auth_node');
return $this;
}
}