AuthController.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. declare (strict_types = 1);
  3. // +----------------------------------------------------------------------
  4. // | [ WE CAN DO IT MORE SIMPLE ]
  5. // +----------------------------------------------------------------------
  6. // | Copyright (c) 2018-2020 rights reserved.
  7. // +----------------------------------------------------------------------
  8. // | Author: TABLE ME
  9. // +----------------------------------------------------------------------
  10. // | Date: 2020-08-25 17:23
  11. // +----------------------------------------------------------------------
  12. namespace app\api\controller;
  13. /**
  14. * 基类 所有控制器继承的类
  15. * Class AuthController
  16. * @package app\adminapi\controller
  17. */
  18. class AuthController extends \app\BaseController
  19. {
  20. /**
  21. * 当前登陆管理员信息[记录日志]
  22. * @var
  23. */
  24. protected $user;
  25. /**
  26. * 初始化
  27. */
  28. protected function initialize()
  29. {
  30. parent::initialize();
  31. $this->user = $this->request->user;
  32. event('UserVisit', [$this->user, 'api']);
  33. }
  34. }