Common.Class.php 985 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * 公共类
  4. * Created by PhpStorm.
  5. * User: 小威
  6. * Date: 2019/11/04
  7. * Time: 10:40
  8. */
  9. namespace Jindouyun\Controller\Common;
  10. use Exception;
  11. use Mall\Framework\Core\ErrorCode;
  12. use Mall\Framework\Factory;
  13. use JinDouYun\Controller\BaseController;
  14. use JinDouYun\Model\UserCenter\MUserCenterLogin;
  15. class Common extends BaseController
  16. {
  17. private $objMUserCenterLogin;
  18. public function __construct($isCheckAcl = false, $isMustLogin = true, $checkToken = false)
  19. {
  20. parent::__construct($isCheckAcl, $isMustLogin, $checkToken = false);
  21. $this->objMUserCenterLogin = new MUserCenterLogin();
  22. }
  23. /**
  24. * 刷新token方法
  25. */
  26. public function flushToken()
  27. {
  28. $result = $this->objMUserCenterLogin->flushToken($this->onlineUserId);
  29. if ($result->isSuccess()) {
  30. parent::sendOutput($result->getData());
  31. } else {
  32. parent::sendOutput($result->getData(), $result->getErrorCode());
  33. }
  34. }
  35. }