src/ApiBundle/Api/Resource/Captcha/Captcha.php

(开头部分) 912B

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace ApiBundle\Api\Resource\Captcha;

use ApiBundle\Api\ApiRequest;
use ApiBundle\Api\Resource\AbstractResource;
use ApiBundle\Api\Annotation\ApiConf;
use Biz\Common\CommonException;

class Captcha extends AbstractResource
{
    /**
     * @ApiConf(isRequiredAuth=false)
     */
    public function add(ApiRequest $request)
    {
        return $this->getBizCaptcha()->generate();
    }

    /**
     * @return \Biz\Common\BizCaptcha
     */
    private function getBizCaptcha()
    {
        return $this->biz['biz_captcha'];
    }

    /**
     * @ApiConf(isRequiredAuth=false)
     */
    public function get(ApiRequest $request, $captchaId)
    {
        if (!($phrase = $request->query->get('phrase'))) {
            throw CommonException::ERROR_PARAMETER_MISSING();
        }

        return array(
            'status' => $this->getBizCaptcha()->check($captchaId, $phrase),
        );
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。