Core.php 866 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. Dever::config('base')->clear_top = 1;
  12. $this->uid = Dever::load('passport/user')->check(false);
  13. if ($this->uid <= 0) {
  14. $this->uid = 15;
  15. }
  16. $this->checkLogin();
  17. if ($this->uid) {
  18. $this->user = Dever::db('option/account')->find($this->uid);
  19. $this->user += Dever::db('option/member')->find($this->user['mid']);
  20. //$this->user['idcard'] = '';
  21. }
  22. if ($this->user) {
  23. $this->user['uid'] = $this->user['id'];
  24. }
  25. }
  26. public function checkLogin()
  27. {
  28. if (!$this->uid || $this->uid <= 0) {
  29. Dever::alert('请先登录', -2);
  30. }
  31. }
  32. }