Skip to content

Commit

Permalink
resolve #53
Browse files Browse the repository at this point in the history
  • Loading branch information
yunwuxin committed May 19, 2020
1 parent 1709574 commit 1eef371
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions composer.json
Expand Up @@ -28,6 +28,5 @@
"captcha": "src/config.php"
}
}
},
"minimum-stability": "dev"
}
}
8 changes: 5 additions & 3 deletions src/CaptchaService.php
Expand Up @@ -8,14 +8,16 @@

class CaptchaService extends Service
{
public function boot(Route $route)
public function boot()
{
$route->get('captcha/[:config]', "\\think\\captcha\\CaptchaController@index");

Validate::maker(function ($validate) {
$validate->extend('captcha', function ($value) {
return captcha_check($value);
}, ':attribute错误!');
});

$this->registerRoutes(function (Route $route) {
$route->get('captcha/[:config]', "\\think\\captcha\\CaptchaController@index");
});
}
}

0 comments on commit 1eef371

Please sign in to comment.