Skip to content

Commit

Permalink
修复点赞不跳转login的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
forecho committed Apr 19, 2016
1 parent 6f077f8 commit a4a40b9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions frontend/modules/user/controllers/ActionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,17 @@
use common\services\TopicService;
use common\services\TweetService;
use Yii;
use yii\filters\AccessControl;
use common\components\Controller;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
use yii\web\NotFoundHttpException;

class ActionController extends Controller
{
public function beforeAction($action)
{
if (Yii::$app->user->isGuest && Yii::$app->getRequest()->url !== Url::to(Yii::$app->getUser()->loginUrl)) {
if (Yii::$app->user->isGuest) {
Yii::$app->getResponse()->redirect(\Yii::$app->getUser()->loginUrl)->send();
return;
}
parent::beforeAction($action);
return parent::beforeAction($action);
}

/**
Expand Down

0 comments on commit a4a40b9

Please sign in to comment.