-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathapi.php
41 lines (40 loc) · 1.45 KB
/
api.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
<?php
error_reporting(2);
$action = htmlspecialchars($_GET['action']);
$callback = htmlspecialchars($_GET['callback']);
if ( $action == 'doc' ) {
$JSON = array(
'code' => 1,
'imgs' => array(
'./upload/MPreview_DOC_1.jpg?ver=1.0.0',
'./upload/MPreview_DOC_1.jpg?ver=2.0.0',
'./upload/MPreview_DOC_1.jpg?ver=3.0.0',
'./upload/MPreview_DOC_1.jpg?ver=4.0.0',
'./upload/MPreview_DOC_1.jpg?ver=5.0.0',
'./upload/MPreview_DOC_1.jpg?ver=6.0.0',
'./upload/MPreview_DOC_1.jpg?ver=7.0.0',
'./upload/MPreview_DOC_1.jpg?ver=8.0.0'
)
);
} else {
$JSON = array(
'code' => 1,
'imgs' => array(
'./upload/MPreview_PPT_1.jpg?ver=1.0.0',
'./upload/MPreview_PPT_1.jpg?ver=2.0.0',
'./upload/MPreview_PPT_1.jpg?ver=3.0.0',
'./upload/MPreview_PPT_1.jpg?ver=4.0.0',
'./upload/MPreview_PPT_1.jpg?ver=5.0.0',
'./upload/MPreview_PPT_1.jpg?ver=6.0.0',
'./upload/MPreview_PPT_1.jpg?ver=7.0.0',
'./upload/MPreview_PPT_1.jpg?ver=8.0.0',
)
);
}
header('Content-type: application/json');
if ( !empty( $_GET['callback'] ) ){
echo $callback.'('.json_encode($JSON).')';
} else {
echo json_encode($JSON);
}
?>