thinkphp6生成验证码
2022-07-28 14:14:58
306
{{single.collect_count}}
验证码路由
//验证码Route::get('captcha/:id','\\think\\captcha\\CaptchaController@index')->allowCrossDomain();Route::get('captcha','User/captcha')->allowCrossDomain();
//生成id$id = mt_rand(10000, 99999);//唯一标识符$uniqid = uniqid("$id");//返回数据,验证码图片路径,验证码标识$data = [//'src' => \think\facade\Request::domain() . captcha_src($uniqid),'src' => 'http://www.ThinkPHP.com'.captcha_src($uniqid),'uniqid' => $uniqid,];return json($data);

修改验证码存储方式

 

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}