Skip to content

Commit

Permalink
微信登录时如果是登录状态直接跳首页
Browse files Browse the repository at this point in the history
  • Loading branch information
xutl committed Jun 19, 2018
1 parent b88a05f commit bfa6047
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/oauth/AuthAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @copyright Copyright (c) 2012 TintSoft Technology Co. Ltd.
* @license http://www.tintsoft.com/license/
*/

namespace xutl\wechat\oauth;

use Yii;
Expand Down Expand Up @@ -50,7 +51,11 @@ class AuthAction extends \yii\authclient\AuthAction
*/
public function run()
{
$client = Yii::$app->wechat->oauth;
return $this->auth($client);
if (Yii::$app->user->isGuest) {
$client = Yii::$app->wechat->oauth;
return $this->auth($client);
} else {
return $this->controller->goHome();
}
}
}

0 comments on commit bfa6047

Please sign in to comment.