Skip to content

Commit 287926d

Browse files
committed
Bugfix. overtrue#199
1 parent 4473ef2 commit 287926d

File tree

2 files changed

+19
-26
lines changed

2 files changed

+19
-26
lines changed

src/ServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ public function register()
9090
}
9191

9292
foreach ($accounts as $account => $config) {
93-
$this->app->singleton("wechat.{$name}.{$account}", function ($laravelApp) use ($name, $account, $class) {
94-
$app = new $class(array_merge(config('wechat.defaults', []), config("wechat.{$name}.{$account}")));
93+
$this->app->singleton("wechat.{$name}.{$account}", function ($laravelApp) use ($name, $account, $config, $class) {
94+
$app = new $class(array_merge(config('wechat.defaults', []), $config));
9595
if (config('wechat.defaults.use_laravel_cache')) {
9696
$app['cache'] = new CacheBridge($laravelApp['cache.store']);
9797
}

src/config.php

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,20 @@
7070
'secret' => env('WECHAT_OFFICIAL_ACCOUNT_SECRET', 'your-app-secret'), // AppSecret
7171
'token' => env('WECHAT_OFFICIAL_ACCOUNT_TOKEN', 'your-token'), // Token
7272
'aes_key' => env('WECHAT_OFFICIAL_ACCOUNT_AES_KEY', ''), // EncodingAESKey
73-
],
7473

75-
/*
76-
* OAuth 配置
77-
*
78-
* only_wechat_browser: 只在微信浏览器跳转
79-
* scopes:公众平台(snsapi_userinfo / snsapi_base),开放平台:snsapi_login
80-
* callback:OAuth授权完成后的回调页地址(如果使用中间件,则随便填写。。。)
81-
*/
82-
// 'oauth' => [
83-
// 'only_wechat_browser' => false,
84-
// 'scopes' => array_map('trim', explode(',', env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_SCOPES', 'snsapi_userinfo'))),
85-
// 'callback' => env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_CALLBACK', '/examples/oauth_callback.php'),
86-
// ],
74+
/*
75+
* OAuth 配置
76+
*
77+
* only_wechat_browser: 只在微信浏览器跳转
78+
* scopes:公众平台(snsapi_userinfo / snsapi_base),开放平台:snsapi_login
79+
* callback:OAuth授权完成后的回调页地址(如果使用中间件,则随便填写。。。)
80+
*/
81+
// 'oauth' => [
82+
// 'only_wechat_browser' => false,
83+
// 'scopes' => array_map('trim', explode(',', env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_SCOPES', 'snsapi_userinfo'))),
84+
// 'callback' => env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_CALLBACK', '/examples/oauth_callback.php'),
85+
// ],
86+
],
8787
],
8888

8989
/*
@@ -131,17 +131,10 @@
131131
*/
132132
// 'work' => [
133133
// 'default' => [
134-
// // 企业 ID
135134
// 'corp_id' => 'xxxxxxxxxxxxxxxxx',
136-
137-
// // 应用列表
138-
// 'agents' => [
139-
// 'contacts' => [
140-
// 'agent_id' => 100020,
141-
// 'secret' => env('WECHAT_WORK_AGENT_CONTACTS_SECRET', ''),
142-
// ],
143-
// //...
144-
// ],
145-
// ],
135+
/// 'agent_id' => 100020,
136+
// 'secret' => env('WECHAT_WORK_AGENT_CONTACTS_SECRET', ''),
137+
// //...
138+
// ],
146139
// ],
147140
];

0 commit comments

Comments
 (0)