Esempio n. 1
0
File: Api.php Progetto: qious/Hnust
 public function __construct($module, $method)
 {
     parent::__construct($module, $method);
     $this->access = Config::getAccess($this->module, $this->method);
     //初始化数据
     $this->token = \Hnust\input('server.HTTP_TOKEN');
     $this->sid = \Hnust\input('sid');
     $this->passwd = \Hnust\input('passwd');
     $this->page = \Hnust\input('page/d', 1);
     $this->page = $this->page < 1 ? 1 : $this->page;
     //权限验证
     $this->auth();
 }
Esempio n. 2
0
File: Auth.php Progetto: qious/Hnust
 public function __construct($module, $method)
 {
     parent::__construct($module, $method);
     $this->access = Config::getAccess($this->module, $this->method);
     $this->NMStatus = 'Admin' === $this->module ? Config::STATE_ADMIN : Config::STATE_NORMAL;
     //初始化数据
     $this->token = \Hnust\input('cookie.token', \Hnust\input('token'));
     $this->key = \Hnust\input('get.key', \Hnust\input('post.key'));
     $this->sid = \Hnust\input('get.sid', \Hnust\input('post.sid'));
     $this->uid = \Hnust\input('uid');
     $this->passwd = \Hnust\input('passwd');
     $this->page = \Hnust\input('page/d', 1);
     $this->page = $this->page < 1 ? 1 : $this->page;
     //初始化缓存
     $this->authCache = new Cache('auth');
     //权限验证
     $this->auth();
 }