1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-24 20:06:09 +08:00
xiaochong0302 5384cb8c87 优化
2020-05-06 20:14:50 +08:00

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');
}
}
}