BLOG API

博客开发的 API 接口


登录

<p>简要描述:</p> <ul> <li>用户登录接口</li> </ul> <p>请求 URL:</p> <ul> <li><code>/api/login</code></li> </ul> <p>请求方式:</p> <ul> <li><code>POST</code></li> </ul> <p>请求体:</p> <table> <thead> <tr> <th style="text-align: center;">参数名</th> <th style="text-align: center;">必选</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: center;">username</td> <td style="text-align: center;">是</td> <td>string</td> <td>用户名</td> </tr> <tr> <td style="text-align: center;">password</td> <td style="text-align: center;">是</td> <td>string</td> <td>密码</td> </tr> </tbody> </table> <p>返回示例:</p> <pre><code class="language-json">{     "status": 0,     "msg": "登录成功",     "token": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwidXNlcm5hbWUiOiJhZG1pbjY2NiIsInBhc3N3b3JkIjoiIiwibmlja19uYW1lIjpudWxsLCJwaWNfbmFtZSI6bnVsbCwiZW1haWxfbmFtZSI6IjY2NjY2NkBxcS5jb20iLCJ1c2VyX2Rlc2NyaWJlIjpudWxsLCJ1c2VyYWRkX3RpbWUiOiIyMDIyLTExLTIxIDE1OjUxOjE0IiwidXNlcnVwZGF0ZV90aW1lIjoiIiwidXNlcl9zdGF0ZSI6MCwiaWF0IjoxNjY5MDE5ODA1LCJleHAiOjE2NzI2MTYyMDV9.1nwnTZfNcsBXaPEoNugn8znhsZ5CueWGZWmlqiTpxxx" }</code></pre> <p>返回参数说明:</p> <table> <thead> <tr> <th style="text-align: center;">参数名</th> <th style="text-align: center;">类型</th> <th style="text-align: center;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: center;">status</td> <td style="text-align: center;">int</td> <td style="text-align: center;">(0:请求成功)(1: 请求失败)</td> </tr> <tr> <td style="text-align: center;">msg</td> <td style="text-align: center;">string</td> <td style="text-align: center;">请求结果的描述消息</td> </tr> <tr> <td style="text-align: center;">token</td> <td style="text-align: center;">string</td> <td style="text-align: center;">用于有权限接口的身份认证</td> </tr> </tbody> </table>

页面列表

ITEM_HTML