-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathGetVerifiedCode_Photo.php
80 lines (71 loc) · 2.22 KB
/
GetVerifiedCode_Photo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
require("./Expand.php");
$Phone = '+' . $_POST['Phone'];
if ($Phone == '') {
echo json_encode(
array(
'Status' => 18
)
); #参数不全
} else {
$Header = array('User-Agent: PikPakWeb (github.com/UallenQbit/PikPakWeb)');
$Url = 'https://user.mypikpak.com/v1/shield/captcha/init';
$Data = json_encode(
array(
'device_id' => '0',
'client_id' => 'YNxT9w7GMdWvEOKa',
'action' => 'POST:/v1/auth/verification',
'meta' => array(
'phone_number' => $Phone
)
)
);
$Result = CurlPost($Url, $Data, $Header);
$JsonData = json_decode($Result, true);
$CaptchaToken = $JsonData['captcha_token'];
if ($CaptchaToken == '') {
echo json_encode(
array(
'Status' => 44
)
); #CaptchaToken获取失败
} else {
$Url = 'https://user.mypikpak.com/v1/auth/verification';
$Data = json_encode(
array(
'client_id' => 'YNxT9w7GMdWvEOKa',
'captcha_token' => $CaptchaToken,
'phone_number' => $Phone
),
true
);
$Result = CurlPost($Url, $Data, $Header);
$JsonData = json_decode($Result, true);
$VerificationID = $JsonData['verification_id'];
if ($VerificationID == '') {
if ($JsonData['error_code'] == 8) {
echo json_encode(
array(
'Status' => 151,
'Message' => $JsonData['error_description']
)
); #验证码发送上限
} else {
echo json_encode(
array(
'Status' => 51,
'Phone' => $Phone,
'Result' => $Result
)
); #验证码发送失败
}
} else {
echo json_encode(
array(
'Status' => 0,
'VerificationID' => $VerificationID
)
);
}
}
}