From 1eef3717c1bcf4f5bbe2d1a1c704011d330a8b55 Mon Sep 17 00:00:00 2001 From: yunwuxin <448901948@qq.com> Date: Tue, 19 May 2020 18:55:45 +0800 Subject: [PATCH] resolve #53 --- composer.json | 3 +-- src/CaptchaService.php | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 5688305..e598819 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,5 @@ "captcha": "src/config.php" } } - }, - "minimum-stability": "dev" + } } diff --git a/src/CaptchaService.php b/src/CaptchaService.php index 27f0ff0..1848858 100644 --- a/src/CaptchaService.php +++ b/src/CaptchaService.php @@ -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"); + }); } }