Ingen beskrivning
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Base.php 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * 易优CMS
  4. * ============================================================================
  5. * 版权所有 2016-2028 海南赞赞网络科技有限公司,并保留所有权利。
  6. * 网站地址: http://www.eyoucms.com
  7. * ----------------------------------------------------------------------------
  8. * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷.
  9. * ============================================================================
  10. * Author: 小虎哥 <1105415366@qq.com>
  11. * Date: 2018-4-3
  12. */
  13. namespace app\plugins\controller;
  14. use app\common\controller\Common;
  15. use think\Db;
  16. class Base extends Common {
  17. /**
  18. * 析构函数
  19. */
  20. function __construct()
  21. {
  22. parent::__construct();
  23. }
  24. /*
  25. * 初始化操作
  26. */
  27. public function _initialize()
  28. {
  29. parent::_initialize();
  30. $users_id = session('users_id');
  31. $users_id = intval($users_id);
  32. if (!empty($users_id)) {
  33. $users = GetUsersLatestData($users_id);
  34. if (empty($users)) {
  35. session('users_id', null);
  36. session('users', null);
  37. cookie('users_id', null);
  38. } else {
  39. if (0 > $users['is_lock'] && IS_POST) {
  40. $users_lock_model = config('global.users_lock_model');
  41. $users_lock_model_msg = !empty($users_lock_model[$users['is_lock']]) ? $users_lock_model[$users['is_lock']]['msg'] : '';
  42. $this->error($users_lock_model_msg);
  43. }
  44. }
  45. $this->users = $users;
  46. $this->users_id = $users['users_id'];
  47. }
  48. }
  49. }