File Coverage

blib/lib/Mojo/Webqq/Client/Remote/_check_login.pm
Criterion Covered Total %
statement 0 15 0.0
branch 0 6 0.0
condition 0 3 0.0
subroutine 0 1 0.0
pod n/a
total 0 25 0.0


line stmt bran cond sub pod time code
1             sub Mojo::Webqq::Client::_check_login {
2 0     0     my $self = shift;
3 0           $self->info("正在检查登录状态...");
4 0 0 0       if($self->search_cookie("supertoken") and $self->search_cookie("superuin")){
5 0           my $content = $self->http_get('https://ssl.ptlogin2.qq.com/pt4_auth?daid=164&appid=501004106&auth_token=' . $self->time33($self->search_cookie("supertoken")), {Referer => 'https://xui.ptlogin2.qq.com/cgi-bin/xlogin?daid=164&target=self&style=40&pt_disable_pwd=1&mibao_css=m_webqq&appid=501004106&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2F' . $self->domain . '%2Fproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20131024001'} );
6 0 0         return 0 if not defined $content;
7 0           my( $retcode,$api_check_sig) = $content=~/'(.*?)'/g;
8 0           $self->info("登录状态检查结果($retcode)");
9 0 0         if( $api_check_sig =~ /^https?:\/\/[^\/]+\.qq\.com\/check_sig/){
10 0           $self->api_check_sig($api_check_sig . '®master=&aid=501004106&s_url=http%3A%2F%2F'. $self->domain . '%2Fproxy.html');
11 0           $self->info("检查结果:登录状态有效,尝试直接恢复登录...");
12 0           return 1;
13             }
14             else{
15 0           $self->info("检查结果:需要重新登录(1)");
16 0           return 0;
17             }
18             }
19             else{
20 0           $self->info("检查结果:需要重新登录(2)");
21 0           return 0;
22             }
23             }
24             1;