|
@@ -47,12 +47,14 @@ class WechatOpenPlatformController extends CatchController
|
|
|
$componentInfo = WechatOpenPlatformService::getComponentInfoByAppid($component_appid);
|
|
|
$app = WechatOpenPlatformService::buildApplication($componentInfo);
|
|
|
$client = $app->getClient();
|
|
|
- $response = $client->post('/cgi-bin/component/api_query_auth', [
|
|
|
+ $response = $client->postJson('/cgi-bin/component/api_query_auth', [
|
|
|
'component_appid' => $component_appid,
|
|
|
'authorization_code' => $auth_code
|
|
|
]);
|
|
|
- $authorizer_appid = $response['authorization_info']['authorizer_appid'];
|
|
|
- $authorizer_refresh_token = $response['authorization_info']['authorizer_refresh_token'];
|
|
|
+ $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'];
|
|
|
|
|
|
WechatAuthorizationInfo::updateOrCreate([
|
|
|
'authorizer_appid' => $authorizer_appid,
|