|
...
|
...
|
@@ -34,20 +34,8 @@ class Wechat |
|
|
|
*/
|
|
|
|
public function getAccessToken()
|
|
|
|
{
|
|
|
|
$cacheKey = 'access_token';
|
|
|
|
if (Cache::has($cacheKey)) {
|
|
|
|
return Cache::get($cacheKey);
|
|
|
|
}
|
|
|
|
$url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $this->appid . '&secret=' . $this->appSecret;
|
|
|
|
var_dump($url);
|
|
|
|
die();
|
|
|
|
$response = http_get($url);
|
|
|
|
value($response);
|
|
|
|
die();
|
|
|
|
$accessToken = $data['access_token'];
|
|
|
|
// 将accessToken缓存起来,避免多次请求
|
|
|
|
Cache::put($cacheKey, $accessToken, $data['expires_in'] / 60);
|
|
|
|
return $accessToken;
|
|
|
|
$token = file_get_contents("http://wechat.globalso.com/api/accesstoken/aicc");
|
|
|
|
return $token;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @remark :生成二维码
|
...
|
...
|
|