|
@@ -52,17 +52,23 @@ class WechatOpenPlatformController extends CatchController
|
|
|
'authorization_code' => $auth_code
|
|
|
]);
|
|
|
$parsedContent = \json_decode($response->getContent(), true);
|
|
|
- myLog('auth')->info('$parsedContent', $parsedContent);
|
|
|
$authorizer_appid = $parsedContent['authorization_info']['authorizer_appid'];
|
|
|
$authorizer_refresh_token = $parsedContent['authorization_info']['authorizer_refresh_token'];
|
|
|
|
|
|
+ $response = $client->postJson('/cgi-bin/component/api_get_authorizer_info', [
|
|
|
+ 'component_appid' => $component_appid,
|
|
|
+ 'authorizer_appid' => $authorizer_appid
|
|
|
+ ]);
|
|
|
+ $parsedContent = \json_decode($response->getContent(), true);
|
|
|
+
|
|
|
WechatAuthorizationInfo::updateOrCreate([
|
|
|
'authorizer_appid' => $authorizer_appid,
|
|
|
'component_appid' => $component_appid,
|
|
|
'user_id' => $user_id,
|
|
|
'puser_id' => $auth_user->pid,
|
|
|
], [
|
|
|
- 'authorizer_refresh_token' => $authorizer_refresh_token
|
|
|
+ 'authorizer_refresh_token' => $authorizer_refresh_token,
|
|
|
+ 'nick_name' => $parsedContent['authorizer_info']['nick_name'],
|
|
|
]);
|
|
|
|
|
|
return view('wechat.openPlatform.authSuccess')->with('url', sprintf('%s/#/user/advertiser',config('app.url')));
|