-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscf.php
48 lines (44 loc) · 1.36 KB
/
scf.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
<?php
function main_handler($event, $context){
$event = json_decode(json_encode($event), true);
$ht = $event['queryString']['ht'];
if ($ht == "h")
{
$id = $event['queryString']['id'];
$url = "http://caiyun.feixin.10086.cn/sh/$id";
return [
'isBase64Encoded' => false,
'statusCode' => 301,
'headers' => [ 'Location' => $url ],
'body' => null
];
}
elseif ($ht == "t")
{
$dt = $event['queryString']['dt'];
$expired = $event['queryString']['expired'];
$sk = $event['queryString']['sk'];
$ufi = $event['queryString']['ufi'];
$zyc = $event['queryString']['zyc'];
$token = $event['queryString']['token'];
$sig = $event['queryString']['sig'];
$url = "http://download.cloud.189.cn/file/downloadFile.action?dt=$dt&expired=$expired&sk=$sk&ufi=$ufi&zyc=$zyc&token=$token&sig=$sig";
return [
'isBase64Encoded' => false,
'statusCode' => 301,
'headers' => [ 'Location' => $url ],
'body' => null
];
}
else
{
$html = "Wrong or missing parameter!";
return [
'isBase64Encoded' => false,
'statusCode' => 200,
'headers' => [ 'Content-Type' => 'text/html' ],
'body' => $html
];
}
}
?>