mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]更新nodeService,去除无效static缓存
This commit is contained in:
parent
b492289b8b
commit
a167b48cb5
@ -44,18 +44,14 @@ class NodeService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取授权节点
|
* 获取授权节点
|
||||||
* @staticvar array $nodes
|
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function getAuthNode() {
|
public static function getAuthNode() {
|
||||||
static $nodes = [];
|
|
||||||
if (empty($nodes)) {
|
|
||||||
$nodes = cache('need_access_node');
|
$nodes = cache('need_access_node');
|
||||||
if (empty($nodes)) {
|
if (empty($nodes)) {
|
||||||
$nodes = Db::name('SystemNode')->where('is_auth', '1')->column('node');
|
$nodes = Db::name('SystemNode')->where('is_auth', '1')->column('node');
|
||||||
cache('need_access_node', $nodes);
|
cache('need_access_node', $nodes);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return $nodes;
|
return $nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user