forked from WangDaLao/image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.php
197 lines (197 loc) · 6.92 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
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<?php
/**
* FILE_NAME: api.php
* From: www.hidove.cn
* Author: Ivey
* Date: 2019/10/10 14:28
*/
$domain = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'];
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>Api文档 - Hidove图床</title>
<?php include "static/view/head.html"; ?>
</head>
<?php include "static/view/nav.html"; ?>
<div class="container">
<div class="card bg-light mt-3 mb-3">
<h5 class="card-header">Hidove图床 Api</h5>
<div class="card-body">
<h3>#图片上传</h3>
<div class="table-responsive">
<!-- /*Hidove-table-small-->
<table class="table table-bordered table-hover Hidove-table-small">
<thead>
<tr>
<th>功能</th>
<th>接口</th>
</tr>
</thead>
<tbody>
<tr>
<td>请求方式</td>
<td>POST</td>
</tr>
<tr>
<td>URL</td>
<td><?php echo $domain;?>/api/upload</td>
</tr>
</tbody>
</table>
</div>
<p class="Hidove-api-tips">请求参数</p>
<div class="table-responsive">
<table class="table table-bordered table-hover ">
<thead>
<tr>
<th>参数名称</th>
<th>类型</th>
<th>是否必须</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>Hidoveimage</td>
<td>File</td>
<td>是</td>
<td>表单名称</td>
</tr>
<tr>
<td>apitype</td>
<td>String</td>
<td>是</td>
<td>上传的图床类型(Ali、Vim_Cn等等)</td>
</tr>
</tbody>
</table>
</div>
<p class="Hidove-api-tips">图床类型参数</p>
<div class="table-responsive">
<table class="table table-bordered table-hover Hidove-table-small">
<thead>
<tr>
<th>图床类型</th>
<th>唯一标识</th>
</tr>
</thead>
<tbody>
<tr>
<td>阿里图床</td>
<td>ali</td>
</tr>
<tr>
<td>Vim_Cn</td>
<td>Vim_Cn</td>
</tr>
<tr>
<td>Upload_Cc</td>
<td>Upload_Cc</td>
</tr>
<tr>
<td>Catbox</td>
<td>Catbox</td>
</tr>
<tr>
<td>SMMS</td>
<td>SMMS</td>
</tr>
<tr>
<td>搜狗</td>
<td>SouGou</td>
</tr>
<tr>
<td>小米</td>
<td>xiaomi</td>
</tr>
<tr>
<td>百度</td>
<td>BaiDu</td>
</tr>
<tr>
<td>奇虎</td>
<td>Qihoo</td>
</tr>
<tr>
<td>京东</td>
<td>Jd</td>
</tr>
<tr>
<td>苏宁</td>
<td>SuNing</td>
</tr>
<tr>
<td>掘金论坛</td>
<td>juejin</td>
</tr>
<tr>
<td>网易</td>
<td>Neteasy</td>
</tr>
<tr>
<td>头条</td>
<td>toutiao</td>
</tr>
<tr>
<td>牛图</td>
<td>niupic</td>
</tr>
</tbody>
</table>
</div>
<p class="Hidove-api-tips">响应参数</p>
<div class="table-responsive">
<table class="table table-bordered table-hover ">
<thead>
<tr>
<td>参数名称</td>
<td>类型</td>
<td>实例值</td>
<td>说明</td>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>Number</td>
<td>200</td>
<td>状态码,成功返回200,失败返回500</td>
</tr>
<tr>
<td>msg</td>
<td>String</td>
<td>success</td>
<td>提示信息</td>
</tr>
<tr>
<td>data</td>
<td>array|object</td>
<td>
<pre><code>"url":{
"ali":"https://ae01.alicdn.com/kf/U81bf4c3201cc4d13b8e943f5f965f530r.jpg"
}</code></pre>
</td>
<td>获取的图片链接数据</td>
</tr>
</tbody>
</table>
</div>
<div>
<p class="Hidove-api-tips">正确响应示例</p>
<pre><code>{
"code":200,
"msg":"success",
"data":{
"url":{
"ali":"https://ae01.alicdn.com/kf/U81bf4c3201cc4d13b8e943f5f965f530r.jpg"
}
}
}</code></pre>
</div>
</div>
</div>
</div>
<?php include "static/view/foot.html"; ?>
</html>