think-captcha验证码config配置无效

浏览:5004 发布日期:2017/03/03
5.0.0 - 严重 - 已关闭
Thinkphp5.0.7按照完全手册上使用验证码,配置config文件中captcha参数无效;

具体操作如下:
1. 教程安装验证码扩展:
# composer require topthink/think-captcha
// "topthink/think-captcha": "^1.0",

2. 配置config.php // 开启路由
'auto_start' => true,
 'url_route_on' => true,

'captcha'  => [
        // 验证码字符集合
        'codeSet'  => '2345678abcdefhijkmnpqrstuvwxyzABCDEFGHJKLMNPQRTUVWXY',
        // 验证码字体大小(px)
        'fontSize' => 25,
        // 是否画混淆曲线
        'useCurve' => true,
         // 验证码图片高度
        'imageH'   => 30,
        // 验证码图片宽度
        'imageW'   => 100,
        // 验证码位数
        'length'   => 4,
        // 验证成功后是否重置
        'reset'    => true,
    ],
3. 模板显示<div><img src="{:captcha_src()}" alt="captcha" /></div>4. 控制器中添加验证
验证通过

问题:
1. 修改config中captcha参数, 验证码无效果;
2. 调试vendor\topthink\think-captcha\src下文件无效,应该未加载;



评论(
后面还有条评论,点击查看>>