Skip to content

Commit

Permalink
改进服务类
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Jun 6, 2019
1 parent 66bde16 commit 9fc0c62
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/CaptchaService.php
Expand Up @@ -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错误!');
});
}
}

0 comments on commit 9fc0c62

Please sign in to comment.