打开Composer中文网 找到thinkphp的扩展包列表-搜索think-captcha 点击第一个topthink/think-captcha 复制安装方法composer require topthink/think-captcha 在think根目录下执行
<?php
return [
//验证码的字符集
'codeSet' => '123456789abcdefghigklmnopqrstuvwxyz',
//字体大小
'fontSize' => 18,
//是否添加混淆曲线
'useCurve' => false;
//验证码图片宽度/高度
'imagW' => 150,
'imagH' => 35,
//验证码的位数
'length' => 4,
//验证成功后是否重置
'reset' => true,
];