Skip to content

Commit bfa6047

Browse files
committed
微信登录时如果是登录状态直接跳首页
1 parent b88a05f commit bfa6047

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/oauth/AuthAction.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @copyright Copyright (c) 2012 TintSoft Technology Co. Ltd.
55
* @license http://www.tintsoft.com/license/
66
*/
7+
78
namespace xutl\wechat\oauth;
89

910
use Yii;
@@ -50,7 +51,11 @@ class AuthAction extends \yii\authclient\AuthAction
5051
*/
5152
public function run()
5253
{
53-
$client = Yii::$app->wechat->oauth;
54-
return $this->auth($client);
54+
if (Yii::$app->user->isGuest) {
55+
$client = Yii::$app->wechat->oauth;
56+
return $this->auth($client);
57+
} else {
58+
return $this->controller->goHome();
59+
}
5560
}
5661
}

0 commit comments

Comments
 (0)