[更新]修改节点过虑

This commit is contained in:
Anyon 2017-04-25 11:50:51 +08:00
parent 76a0653e7a
commit 511cd20a4f

View File

@ -14,7 +14,6 @@
namespace app\admin\model; namespace app\admin\model;
use think\Config;
use think\Db; use think\Db;
/** /**
@ -33,10 +32,7 @@ class NodeModel {
public static function applyAuthNode() { public static function applyAuthNode() {
cache('need_access_node', null); cache('need_access_node', null);
if (($authorize = session('user.authorize'))) { if (($authorize = session('user.authorize'))) {
$authorizeids = Db::name('SystemAuth') $authorizeids = Db::name('SystemAuth')->where('id', 'in', explode(',', $authorize))->where('status', '1')->column('id');
->where('id', 'in', explode(',', $authorize))
->where('status', '1')
->column('id');
if (empty($authorizeids)) { if (empty($authorizeids)) {
return session('user.nodes', []); return session('user.nodes', []);
} }
@ -76,7 +72,7 @@ class NodeModel {
if (!in_array($auth_node, self::getAuthNode())) { if (!in_array($auth_node, self::getAuthNode())) {
return true; return true;
} }
return in_array($auth_node, (array)session('user.nodes')); return in_array($auth_node, (array) session('user.nodes'));
} }
/** /**
@ -91,7 +87,7 @@ class NodeModel {
$nodes = []; $nodes = [];
$ignore = [ $ignore = [
'index', 'index',
'wechat/api', 'wechat/notify', 'wechat/api', 'wechat/notify', 'wechat/review',
'admin/plugs', 'admin/login', 'admin/index', 'admin/plugs', 'admin/login', 'admin/index',
]; ];
foreach (self::getNodeTree(APP_PATH) as $thr) { foreach (self::getNodeTree(APP_PATH) as $thr) {