File Coverage

blib/lib/Mojo/Webqq/Client/Remote/_login2.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::_login2{
2 0     0     my $self = shift;
3 0           $self->info("正在进行登录(2)...");
4 0           my $api_url = 'http://d1.web2.qq.com/channel/login2';
5 0           my $headers = {
6             Referer => 'http://d1.web2.qq.com/proxy.html?v=20151105001&callback=1&id=2',
7             json => 1,
8             };
9 0           my %r = (
10             status => $self->mode,
11             ptwebqq => $self->ptwebqq,
12             clientid => $self->clientid,
13             psessionid => $self->psessionid,
14             );
15            
16             #if($self->{type} eq 'webqq'){
17             # $r{passwd_sig} = $self->passwd_sig;
18             #}
19            
20 0           my $data = $self->http_post($api_url,$headers,form=>{r=>$self->to_json(\%r)});
21 0 0         return 0 unless defined $data;
22 0 0         if($data->{retcode} ==0){
23 0 0 0       if(defined $self->uid and $self->uid ne $data->{result}{uin}){
24 0           $self->fatal("实际登录帐号和程序预设帐号不一致");
25 0           $self->stop();
26 0           return 0;
27             }
28             $self->uid($data->{result}{uin})
29             ->psessionid($data->{result}{psessionid})
30             #->vfwebqq($data->{result}{vfwebqq})
31 0           ->login_state('success')
32             ->_cookie_proxy();
33 0           return 1;
34             }
35 0           return 0;
36             }
37             1;