核实验室


图片上传

<h2>图片上传</h2> <h3>接口描述</h3> <p>该接口用于上传图片,上传成功后拿到图片地址</p> <h3>请求方式</h3> <p>POST</p> <h3>请求地址</h3> <p><code>/nrl/api/img/upload</code></p> <h3>请求参数</h3> <ul> <li>&lt;font color='red'&gt;header需要带授权X-Token&lt;/font&gt;</li> </ul> <table> <thead> <tr> <th>参数名</th> <th>参数类型</th> <th>是否必填</th> <th>参数描述</th> </tr> </thead> <tbody> <tr> <td>file</td> <td>MultipartFile</td> <td>是</td> <td>文件</td> </tr> </tbody> </table> <h3>响应参数</h3> <table> <thead> <tr> <th>参数名</th> <th>参数类型</th> <th>参数描述</th> </tr> </thead> <tbody> <tr> <td>name</td> <td>string</td> <td>图片名称</td> </tr> <tr> <td>url</td> <td>string</td> <td>图片地址(可直接访问)</td> </tr> </tbody> </table> <h3>响应示例</h3> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 200, &amp;quot;message&amp;quot;: &amp;quot;操作成功&amp;quot;, &amp;quot;data&amp;quot;: { &amp;quot;name&amp;quot;: &amp;quot;美图.jpg&amp;quot;, &amp;quot;url&amp;quot;: &amp;quot;http://nrl.oss-cn-shenzhen.aliyuncs.com/nrl/images/20200607/5b07ca8aN4e127d2f.jpg&amp;quot; } }</code></pre> <h3>错误码</h3> <table> <thead> <tr> <th>错误码</th> <th>错误信息</th> </tr> </thead> <tbody> <tr> <td>500</td> <td>操作失败</td> </tr> <tr> <td>401</td> <td>暂未登录或token已经过期</td> </tr> <tr> <td>403</td> <td>没有相关权限</td> </tr> <tr> <td>404</td> <td>参数检验失败</td> </tr> </tbody> </table>

页面列表

ITEM_HTML