mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-24 20:06:09 +08:00
23 lines
425 B
PHP
23 lines
425 B
PHP
<?php
|
|
|
|
namespace App\Validators;
|
|
|
|
use App\Exceptions\BadRequest as BadRequestException;
|
|
use App\Services\Captcha as CaptchaService;
|
|
|
|
class Captcha extends Validator
|
|
{
|
|
|
|
public function checkCode($ticket, $rand)
|
|
{
|
|
$service = new CaptchaService();
|
|
|
|
$result = $service->verify($ticket, $rand);
|
|
|
|
if (!$result) {
|
|
throw new BadRequestException('captcha.invalid_code');
|
|
}
|
|
}
|
|
|
|
}
|