代码拉取完成,页面将自动刷新
tp6.0 ThinkAdmin 生成二维码
软件架构说明
示例代码如下php
info['path'] = '/ucserver/api.Tools/qrcode'; $this->info = json_encode($this->info,JSON_UNESCAPED_UNICODE); $this->fetch(); } /** * 生成二维码 * @param string */ public function qrcode($data = ''){ $qrCode = new QrCode(); $qrCode ->setText($data) ->setSize(300) ->setPadding(10) ->setErrorCorrection('high') ->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]) ->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0]) ->setLabel('') ->setLabelFontSize(16) ->setImageType(QrCode::IMAGE_TYPE_PNG); header('Content-Type: '.$qrCode->getContentType());//输出到页面 $qrCode->render(); die; } }此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。