Webqq/Client/Remote/_get_vfwebqq.pm untested

filter: Statementstmt 0.0% 0 / 12 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 1 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 18 CC 3 SCAR 24.8
CC
3
Cov
0%
Mojo::Webqq::Client::_get_vfwebqq
12.0
CRAP 12.0
1 sub Mojo::Webqq::Client::_get_vfwebqq {
2 my $self = shift;
3 $self->info("获取数据验证参数...\n");
4 my $api_url = 'https://s.web2.qq.com/api/getvfwebqq';
5 my @query_string = (
6 ptwebqq => $self->ptwebqq,
7 clientid => $self->clientid,
8 psessionid => $self->psessionid,
9 t => time(),
10 );
11 my $headers = {
12 Referer => 'https://s.web2.qq.com/proxy.html?v=20130916001&callback=1&id=1',
13 json => 1,
14 ua_request_timeout => 10,
15 ua_retry_times => 3,
16 };
17
18 my $json = $self->http_get($self->gen_url($api_url,@query_string),$headers);
19 return undef unless defined $json;
20 if($json->{retcode}!=0){
21 $self->error("获取数据验证参数失败...");
22 return 0;
23 }
24 $self->vfwebqq($json->{result}{vfwebqq});
25 return 1;
26 }
27 1;