------------------- 程序特色 ----------------------
发送空投:支持发送文字、图片、语音、视频等多种类型的空投
接受空投:用户在输入对应的空投后,可以查看到空投内容并回复
吐槽广场:用户内部的小论坛,支持分享图片、点赞、选择分类等
短信通知:支持微信转发空投,短信通知空投,内置接口发送方便
部署简单:内置网站一键自动安装,快速部署上线,配置简单
源码下载地址:小空投公众号版https://wwi.lanzoup.com/b056tfqsf 密码:6rxr
---------------- 代码介绍 ----------------
public function qrcode(){
$text = $this->request->param("text","");
$M = new QrCode();
$M->setText($text)
->setSize(300)
->setPadding(10)
->setErrorCorrection('high')
->setForegroundColor(array('r' => 0, 'g' => 0, 'b' => 0, 'a' => 0))
->setBackgroundColor(array('r' => 255, 'g' => 255, 'b' => 255, 'a' => 0))
->setImageType(QrCode::IMAGE_TYPE_PNG);
$content = $M->get();
return response($content, 200, ['Content-Length' => strlen($content)])->contentType($M->getContentType());
}
public function qrcode3(){
$text = $this->request->param("text","");
// $token = $this->request->param("token","");
// if(empty($text) || empty($token) || !check_token($text, $token)){
// return;
// }
$qrCode = new EnQrcode(Request::domain()."/index.html#" . $text);
header('Content-Type: '.$qrCode->getContentType());
$qrCode->setSize(500);
$qrCode->setErrorCorrectionLevel(new ErrorCorrectionLevel('high'));
// $qrCode->setLogoPath('./static/common/images/qrcode_logo.png');
$qrCode->setLogoSize(75, 75);
$content = $qrCode->writeString();
return response($content, 200, ['Content-Length' => strlen($content)])->contentType($qrCode->getContentType());
}
protected function validate(array $data, $validate, array $message = [], bool $batch = false)
{
if (is_array($validate)) {
$v = new Validate();
$v->rule($validate);
} else {
if (strpos($validate, '.')) {
// 支持场景
list($validate, $scene) = explode('.', $validate);
}
$class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
$v = new $class();
if (!empty($scene)) {
$v->scene($scene);
}
}
$v->message($message);
// 是否批量验证
if ($batch || $this->batchValidate) {
$v->batch(true);
}
return $v->failException(true)->check($data);
}