wang hou sheng 8 months ago
parent 1d3187c333
commit bb0806e856
  1. 4
      app/common/library/wxserver/Server.php

@ -123,8 +123,8 @@ class Server
$data['component_appid'] = self::APPID; $data['component_appid'] = self::APPID;
$data['authorization_code'] = $authorization_code; $data['authorization_code'] = $authorization_code;
$result = $this->curlPost($url, json_encode($data)); $result = $this->curlPost($url, json_encode($data));
Db::table('yoshop_wx_server')->insertGetId(['content' => $result, 'created_at' => date('Y-m-d H:i:s')]);
$result = json_decode($result, true); $result = json_decode($result, true);
Db::table('yoshop_wx_server')->insertGetId(['content' => json_encode($result), 'created_at' => date('Y-m-d H:i:s')]);
if ($result && !empty($result['authorization_info']) && !empty($result['authorization_info']['authorizer_appid'])) { if ($result && !empty($result['authorization_info']) && !empty($result['authorization_info']['authorizer_appid'])) {
Db::table('yoshop_wx_server')->insertGetId(['content' => '获取详情' . $authorization_code, 'created_at' => date('Y-m-d H:i:s')]); Db::table('yoshop_wx_server')->insertGetId(['content' => '获取详情' . $authorization_code, 'created_at' => date('Y-m-d H:i:s')]);
$url = 'https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_info?component_access_token=' . $this->getComponentAccessToken(); $url = 'https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_info?component_access_token=' . $this->getComponentAccessToken();
@ -132,8 +132,8 @@ class Server
$data['component_appid'] = self::APPID; $data['component_appid'] = self::APPID;
$data['authorizer_appid'] = $result['authorization_info']['authorizer_appid']; $data['authorizer_appid'] = $result['authorization_info']['authorizer_appid'];
$res = $this->curlPost($url, json_encode($data)); $res = $this->curlPost($url, json_encode($data));
Db::table('yoshop_wx_server')->insertGetId(['content' => $res, 'created_at' => date('Y-m-d H:i:s')]);
$res = json_decode($res, true); $res = json_decode($res, true);
Db::table('yoshop_wx_server')->insertGetId(['content' => json_encode($res), 'created_at' => date('Y-m-d H:i:s')]);
if ($res && !empty($res['authorizer_info']) && !empty($res['authorization_info'])) { if ($res && !empty($res['authorizer_info']) && !empty($res['authorization_info'])) {
$authorizer_info = $res['authorizer_info']; $authorizer_info = $res['authorizer_info'];
$authorization_info = $res['authorization_info']; $authorization_info = $res['authorization_info'];

Loading…
Cancel
Save