From 663aeb5e3b1ded1a70d0b362b1867778dcf750b9 Mon Sep 17 00:00:00 2001 From: Xu Tongle Date: Fri, 29 Jun 2018 18:24:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Wechat.php | 5 ++++- src/oauth/OAuth.php | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Wechat.php b/src/Wechat.php index 4808041..feaa9b8 100644 --- a/src/Wechat.php +++ b/src/Wechat.php @@ -219,7 +219,10 @@ public function coreComponents() return [ 'accessToken' => ['class' => 'xutl\wechat\AccessToken'], 'oauth' => ['class' => 'xutl\wechat\oauth\OAuth'], - 'openOAuth' => ['class' => 'xutl\wechat\oauth\OAuth'], + 'openOAuth' => [ + 'class' => 'xutl\wechat\oauth\OAuth', + 'defaultName' => 'wechat_open' + ], 'miniProgram' => ['class' => 'xutl\wechat\oauth\MiniOAuth'], 'js' => ['class' => 'xutl\wechat\js\Js'], 'notice' => ['class' => 'xutl\wechat\notice\Notice'], diff --git a/src/oauth/OAuth.php b/src/oauth/OAuth.php index 15f6b2d..079b298 100644 --- a/src/oauth/OAuth.php +++ b/src/oauth/OAuth.php @@ -45,6 +45,8 @@ class OAuth extends WeChat */ public $useOpenId = true; + public $defaultName = 'wechat'; + /** * @inheritdoc */ @@ -78,7 +80,7 @@ protected function defaultNormalizeUserAttributeMap() */ protected function defaultName() { - return 'wechat'; + return $this->defaultName; } /**