File Coverage

blib/lib/Mojo/Weixin/Model/Remote/_webwxverifyuser.pm
Criterion Covered Total %
statement 0 16 0.0
branch 0 12 0.0
condition 0 2 0.0
subroutine 0 1 0.0
pod n/a
total 0 31 0.0


line stmt bran cond sub pod time code
1             sub Mojo::Weixin::_webwxverifyuser {
2 0     0     my $self = shift;
3 0           my $id = shift;
4 0           my $content = shift;
5 0           my $opcode = shift;
6 0           my $ticket = shift;
7              
8 0 0         $content = "" if not defined $content;
9 0 0         $opcode = 2 if not defined $opcode;
10 0 0         $ticket = "" if not defined $ticket;
11              
12 0           my $api = 'https://' . $self->domain . '/cgi-bin/mmwebwx-bin/webwxverifyuser';
13 0           my @query_string = (
14             r => $self->now(),
15             );
16 0 0         push @query_string,(pass_ticket=>$self->url_escape($self->pass_ticket)) if $self->pass_ticket;
17 0   0       my $post = {
18             BaseRequest => {
19             Uin => $self->wxuin,
20             Sid => $self->wxsid,
21             Skey => $self->skey,
22             DeviceID => $self->deviceid,
23             },
24             Opcode => $opcode,
25             VerifyUserListSize => 1,
26             VerifyUserList=>[{
27             Value => $id,
28             VerifyUserTicket => $ticket,
29             }],
30             VerifyContent => $content || "",
31             SceneListCount => 1,
32             SceneList => [33],
33             skey => $self->skey,
34             };
35              
36 0           my $json = $self->http_post($self->gen_url($api,@query_string),{json=>1,Referer=>'https://' . $self->domain . '/'},json=>$post);
37 0 0         return if not defined $json;
38 0 0         return if $json->{BaseResponse}{Ret}!=0;
39 0           return 1;
40             }
41              
42             1;