From 9fc0c627d773f6a54a8dd142ebf358f746557a48 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 6 Jun 2019 15:16:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E6=9C=8D=E5=8A=A1=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CaptchaService.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/CaptchaService.php b/src/CaptchaService.php index f0cd358..27f0ff0 100644 --- a/src/CaptchaService.php +++ b/src/CaptchaService.php @@ -8,12 +8,14 @@ class CaptchaService extends Service { - public function boot(Route $route, Validate $validate) + public function boot(Route $route) { $route->get('captcha/[:config]', "\\think\\captcha\\CaptchaController@index"); - $validate->extend('captcha', function ($value) { - return captcha_check($value); - }, ':attribute错误!'); + Validate::maker(function ($validate) { + $validate->extend('captcha', function ($value) { + return captcha_check($value); + }, ':attribute错误!'); + }); } }