TestController.php 660 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace mobile\controllers;
  3. use common\services\xhUserService;
  4. use Yii;
  5. class TestController extends MobileendController
  6. {
  7. public $withoutLogin = ['logout', 'login'];
  8. //模拟退出 shish 2019.8.25
  9. public function actionLogout()
  10. {
  11. xhUserService::logout();
  12. var_dump($this->isLogin);
  13. }
  14. //模拟登陆 shish 2019.8.25
  15. public function actionLogin()
  16. {
  17. $customerId = Yii::$app->request->get('customerId');
  18. $customerId = $customerId ? intval($customerId) : 12536630;
  19. xhUserService::logout();
  20. $user = xhUserService::getById($customerId);
  21. xhUserService::loginByThird($user);
  22. var_dump($this->isLogin);
  23. echo $this->userId;
  24. }
  25. }