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; } /**