时间:2021-07-01 10:21:17 帮助过:17人阅读
publicfunctionactionGenerateQrcode()
{//获取设备id$data['device_id'] = $this->getQuery('deviceid');
// require_once ($lib_file);
Yii::import('application.modules.Libraries.*');
$lib_file = 'qrcode/phpqrcode.php';
require_once ($lib_file);
// 纠错级别:L、M、Q、H$errorCorrectionLevel = 'M';
// 点的大小:1到10,2.6(64*64)$matrixPointSize = 5;
$device = DeviceComponent::shake($this->accesstoken)->listbydevice($data);
$url = $this->generatedeviceurl($device['devices'][0]);
QRcode::png($url, false, $errorCorrectionLevel, $matrixPointSize, 2);
exit;
}
生成二维码所需链接
publicfunctiongeneratedeviceurl($data = array())
{$url = "https://zb.weixin.qq.com/nearby/device/v3/clipboard.xhtml?uuid=".$data['uuid']."&major=".$data['major']."&minor=".$data['minor'];
return$url;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。
以上就介绍了微信二维码生成,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。