代码更新

This commit is contained in:
2018-03-01 11:06:03 +08:00
parent 88dbcb9c4b
commit d1327a26f4
2 changed files with 37 additions and 1 deletions

View File

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

View File

@@ -0,0 +1,36 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace app\common\model;
/**
* 菜单模型类
* @author molong <molong@tensent.cn>
*/
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;
}
}