|
|
|
@ -142,6 +142,9 @@ class Server |
|
|
|
|
$info = $info->toArray(); |
|
|
|
|
$access_token = $this->authorizerAccessToken($appid, $info['refresh_token']); |
|
|
|
|
if ($access_token) { |
|
|
|
|
$savePath = root_path() . "public/wxserve/experience"; |
|
|
|
|
!is_dir($savePath) && mkdir($savePath, 0755, true); |
|
|
|
|
$savePath .= '/' . $appid . 'jpg'; |
|
|
|
|
$url = 'https://api.weixin.qq.com/wxa/get_qrcode?access_token=' . $access_token; |
|
|
|
|
$ch = curl_init(); |
|
|
|
|
curl_setopt($ch, CURLOPT_URL, $url); |
|
|
|
@ -150,12 +153,12 @@ class Server |
|
|
|
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // 同上 |
|
|
|
|
$qrcode_response = curl_exec($ch); |
|
|
|
|
curl_close($ch); |
|
|
|
|
$qrcode_response = json_decode($qrcode_response, true); |
|
|
|
|
var_dump($url); |
|
|
|
|
exit(); |
|
|
|
|
if (file_put_contents($savePath, $qrcode_response)) { |
|
|
|
|
return '/wxserve/experience/' . $appid . '.jpg'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return []; |
|
|
|
|
return ''; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|