mirror of
https://gitee.com/fastadminnet/think-captcha.git
synced 2026-07-01 14:02:47 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1a0260861 | ||
|
|
988d165aae | ||
|
|
6ab79cc547 | ||
|
|
9bf096c29a |
@@ -2,7 +2,7 @@
|
||||
thinkphp5 验证码类库
|
||||
|
||||
## 安装
|
||||
> composer install topthink/think-captcha
|
||||
> composer require topthink/think-captcha
|
||||
|
||||
|
||||
##使用
|
||||
|
||||
@@ -12,9 +12,8 @@
|
||||
namespace think\captcha;
|
||||
|
||||
use think\Config;
|
||||
use think\Controller;
|
||||
|
||||
class CaptchaController extends Controller
|
||||
class CaptchaController
|
||||
{
|
||||
public function index($id = "")
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
function captcha($id = "", $config = [])
|
||||
{
|
||||
$captcha = new \think\Captcha($config);
|
||||
$captcha = new \think\captcha\Captcha($config);
|
||||
$captcha->entry($id);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ function captcha($id = "", $config = [])
|
||||
*/
|
||||
function captcha_src($id = "")
|
||||
{
|
||||
return \think\Url::build('/captcha' . $id ? "/{$id}" : '');
|
||||
return \think\Url::build('/captcha' . ($id ? "/{$id}" : ''));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user