Core.php 819 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace Option\Lib;
  3. use Dever;
  4. class Core
  5. {
  6. protected $uid = -1;
  7. protected $use = array();
  8. public $data = array();
  9. public function __construct()
  10. {
  11. $this->uid = Dever::load('passport/user')->check(false);
  12. if ($this->uid <= 0) {
  13. $this->uid = 5;
  14. }
  15. $this->checkLogin();
  16. if ($this->uid) {
  17. $this->user = Dever::db('option/account')->find($this->uid);
  18. $this->user += Dever::db('option/member')->find($this->user['mid']);
  19. //$this->user['idcard'] = '';
  20. }
  21. if ($this->user) {
  22. $this->user['uid'] = $this->user['id'];
  23. }
  24. }
  25. public function checkLogin()
  26. {
  27. if (!$this->uid || $this->uid <= 0) {
  28. Dever::alert('请先登录', -2);
  29. }
  30. }
  31. }