$token = $this->getWxToken();
$url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=$token";
$data = [
'path' => 'pages/index/detail?id=2057'
];
$result = httpsCurl($url, json_encode($data), 'POST');
$path = ROOT_PATH. 'public' . DS .'uploads'. DS;
$filename= time().'.png';
$filePath = $path . $filename;
if(!file_exists($filePath)) {
touch($filePath);
}
$file = fopen($filePath,"w+");//打开文件准备写入
fwrite($file,$result);//写入
fclose($file);//关闭