用户登录
<p>[TOC]</p>
<h5>简要描述</h5>
<ul>
<li>用户登录接口</li>
</ul>
<h5>请求URL</h5>
<ul>
<li><code>http://localhost:3000/admin/api/user/login</code></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>POST </li>
</ul>
<h5>请求头</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">键名</th>
<th style="text-align: left;">必选</th>
<th style="text-align: left;">值类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Content-Type</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>数据编码</td>
</tr>
</tbody>
</table>
<h5>参数</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">必选</th>
<th style="text-align: left;">值类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">username</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>用户名</td>
</tr>
<tr>
<td style="text-align: left;">password</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>密码</td>
</tr>
</tbody>
</table>
<h5>返回示例</h5>
<h6>成功示例</h6>
<pre><code> {
&quot;error_code&quot;: 200,
&quot;msg&quot;: &quot;登录成功!&quot;,
&quot;data&quot;: {
token: &quot;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NDY1ZTUyYmQxZGExNTk1MzY2ZjNkZWMiLCJ1c2VybmFtZSI6ImN1aWh1YSIsInN0YXJ0VGltZSI6MTY4NDQ2MTY4MDk1NCwiZXhwaXJlcyI6NzIwMDAwMCwiaWF0IjoxNjg0NDYxNjgwfQ.cFR4-S5T1ypis94dh8FIGgfDa2V1HvUaEt6rOZNM0tE&quot;,
username: &quot;cuihua&quot;,
userId: &quot;6465e52bd1da1595366f3dec&quot;,
auths: [
{
icon: &quot;el-icon-s-custom&quot;,
isShow: true,
name: &quot;用户管理&quot;,
parentId: &quot;0&quot;,
_id: &quot;645f620e6e33032c1c109a1b&quot;,
children:[
{_id: &quot;645f989ee0997149f5c68a17&quot;, name: &quot;用户添加&quot;, path: &quot;/user/add&quot;, ...},
...
]
},
...
]
}
}</code></pre>
<h5>返回参数说明</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">error_code</td>
<td style="text-align: left;">int</td>
<td>响应状态码,200成功</td>
</tr>
</tbody>
</table>
<h5>备注</h5>
<ul>
<li>更多返回错误代码请看首页的错误代码描述</li>
</ul>