1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace Active\Lib;
- use Dever;
- Class Coreoff
- {
- protected $uid = -1;
- protected $use = array();
- protected $check = true;
- public $data = array();
- public function __construct()
- {
- $this->uid = Dever::load('passport/user')->check(false);
- if ($this->uid <= 0) {
- // $this->uid = 1;
- }
- if ($this->check) {
- $this->checkLogin();
- }
-
- if ($this->uid) {
- $this->user = Dever::db('active/info_off')->find($this->uid);
- // $this->user['uid'] = $this->user['id'];
- }
- if ($this->check) {
- if ($this->user) {
- $this->user['uid'] = $this->user['id'];
- }
- }
- }
- public function checkLogin()
- {
- if (!$this->uid || $this->uid <= 0) {
- Dever::alert('请先登录', -2);
- }
- }
- }
|