Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Kabutack opened this issue Apr 11, 2017 · 0 comments

Comments

@Kabutack
Copy link

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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant