Skip to content

Login.php,getCaptcha($path)函数中,为何是判断statusCode=200的时候报错呢? #2

@Kabutack

Description

@Kabutack
public function getCaptcha($path)
{
    $url = Config::get('url.login_captcha');
    $cookie = new CookieJar();
    $codePath = $path . sha1($this->getUsername() . '-' . microtime(true)) . '.gif';
    $options = ['cookies' => $cookie, 'save_to' => $codePath];
    $response = $this->request('get', [$url, [], $options]);
    // Check the StatusCode 
    if ($response->getStatusCode() == 200) {
        throw new HttpException('get the captcha failed!', 10005);
    }
    return $codePath;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions