|
...
|
...
|
@@ -39,10 +39,8 @@ class Wechat |
|
|
|
return Cache::get($cacheKey);
|
|
|
|
}
|
|
|
|
$url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $this->appid . '&secret=' . $this->appSecret;
|
|
|
|
$client = new Client();
|
|
|
|
$response = $client->get($url);
|
|
|
|
$data = json_decode($response->getBody(), true);
|
|
|
|
value($data);
|
|
|
|
$response = http_get($url);
|
|
|
|
value($response);
|
|
|
|
die();
|
|
|
|
$accessToken = $data['access_token'];
|
|
|
|
// 将accessToken缓存起来,避免多次请求
|
...
|
...
|
|