tp6队列消息
composer require topthink/think-queue
//配置文件位于config/queue.php
[
'default'=>'sync' //驱动类型,可选择 sync(默认):同步执行,database:数据库驱动,redis:Redis驱动,topthink:Topthink驱动
]
验证码生成composer require topthink/think-captcha
//控制器中
public function captcha($id = '')
{
return captcha($id);
}
//路由定义
\think\facade\Route::get('captcha/[:id]', "\\think\\captcha\\CaptchaController@index");
//验证
$this->validate($data,[
'captcha|验证码'=>'require|captcha'
]);
//手动验证
if(!captcha_check($captcha)){
//验证失败
};