[更新]更新nodeService,去除无效static缓存

This commit is contained in:
Anyon 2017-05-08 11:36:25 +08:00
parent b492289b8b
commit a167b48cb5

View File

@ -44,17 +44,13 @@ class NodeService {
/**
* 获取授权节点
* @staticvar array $nodes
* @return array
*/
public static function getAuthNode() {
static $nodes = [];
$nodes = cache('need_access_node');
if (empty($nodes)) {
$nodes = cache('need_access_node');
if (empty($nodes)) {
$nodes = Db::name('SystemNode')->where('is_auth', '1')->column('node');
cache('need_access_node', $nodes);
}
$nodes = Db::name('SystemNode')->where('is_auth', '1')->column('node');
cache('need_access_node', $nodes);
}
return $nodes;
}