cainiaoer / think-captcha
thinkphp captcha api extension
1.0.6
2025-06-18 03:27 UTC
Requires
- php: 8.2
- topthink/framework: 8.1
This package is not auto-updated.
Last update: 2025-06-18 06:43:23 UTC
README
thinkphp 验证码类库API版, 基于tp原有验证码类库做了小调整,将依赖从Session调整到Cache,缓存类型默认为文件缓存,如有需要自行调整配置captcha.php中的cache缓存类型
安装
不能与topthink/think-captcha同时使用,否则会引起冲突
composer require cainiaoer/think-captcha
使用
// 助手函数,$uid为客户端传过来的验证码唯一标识符
captcha($uid)
验证
if(!captcha_check($uid,$captcha)){
//验证失败
};