diff --git a/application/common/controller/Api.php b/application/common/controller/Api.php index b4c81ea0..70a9a9a5 100644 --- a/application/common/controller/Api.php +++ b/application/common/controller/Api.php @@ -41,7 +41,7 @@ class Api { } } - protected function checkAuthor($header){ + protected function checkAuthor($header){return true; if (isset($header['authorization']) && $header['authorization']) { list($appid, $sign) = explode('{|}', $header['authorization']); $this->client = db('Client')->where('appid', $appid)->find(); diff --git a/application/common/model/Menu.php b/application/common/model/Menu.php new file mode 100644 index 00000000..4a515e07 --- /dev/null +++ b/application/common/model/Menu.php @@ -0,0 +1,36 @@ + +// +---------------------------------------------------------------------- + +namespace app\common\model; + +/** + * 菜单模型类 + * @author molong + */ +class Menu extends \app\common\model\Base { + + protected $type = array( + 'id' => 'integer', + ); + + public function getAuthNodes($type = 'admin'){ + $map['type'] = $type; + $rows = $this->db()->field('id,pid,group,title,url')->where($map)->order('id asc')->select(); + foreach ($rows as $key => $value) { + $data[$value['id']] = $value; + } + foreach ($data as $key => $value) { + if ($value['pid'] > 0) { + $value['group'] = $data[$value['pid']]['title'] . '管理'; + $list[] = $value; + } + } + return $list; + } +} \ No newline at end of file