diff --git a/README.md b/README.md index 03a058f..6c2257e 100644 --- a/README.md +++ b/README.md @@ -386,10 +386,8 @@ You just need input your config like below config. Official Accounts authorizati // Open Platform - Third-party Platform Need 'component' => [ - // or 'app_id', 'component_app_id' as key 'id' => 'component-app-id', - // or 'app_token', 'access_token', 'component_access_token' as key - 'token' => 'component-access-token', + 'token' => 'component-access-token', // or Using a callable as value. ] ] ], diff --git a/src/Providers/WeChat.php b/src/Providers/WeChat.php index fd9ae78..b8df506 100644 --- a/src/Providers/WeChat.php +++ b/src/Providers/WeChat.php @@ -214,6 +214,10 @@ protected function prepareForComponent() $component = $this->getConfig()->get('component'); foreach ($component as $key => $value) { + if (\is_callable($value)) { + $value = \call_user_func($value, $this); + } + switch ($key) { case 'id': case 'app_id':