正在显示
1 个修改的文件
包含
2 行增加
和
4 行删除
| @@ -39,10 +39,8 @@ class Wechat | @@ -39,10 +39,8 @@ class Wechat | ||
| 39 | return Cache::get($cacheKey); | 39 | return Cache::get($cacheKey); |
| 40 | } | 40 | } |
| 41 | $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $this->appid . '&secret=' . $this->appSecret; | 41 | $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $this->appid . '&secret=' . $this->appSecret; |
| 42 | - $client = new Client(); | ||
| 43 | - $response = $client->get($url); | ||
| 44 | - $data = json_decode($response->getBody(), true); | ||
| 45 | - value($data); | 42 | + $response = http_get($url); |
| 43 | + value($response); | ||
| 46 | die(); | 44 | die(); |
| 47 | $accessToken = $data['access_token']; | 45 | $accessToken = $data['access_token']; |
| 48 | // 将accessToken缓存起来,避免多次请求 | 46 | // 将accessToken缓存起来,避免多次请求 |
-
请 注册 或 登录 后发表评论