登录获取token
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/b77afccd157028d5b445fbc8d32c0f50" alt="" />
<strong>服务:</strong>api-cloud
<strong>API: </strong><code>cloud-api1.51wanxue.com/api-cloud/auth/login</code>
<strong>案例: </strong><code>curl --header 'content-type: application/json' --request POST -d '{&quot;appKey&quot;:&quot;1e612bb58ea64aef9a9e794df6290c8c&quot;,&quot;appSecret&quot;: &quot;20dca3d26a0f47d386e9b86635aec8cb&quot;}' http://cloud-api1.51wanxue.com/api-cloud/auth/login</code>
<strong>请求方式:</strong>POST
<strong>入参方式:</strong> Body raw方式
<strong>api开发者:</strong> 观李
<strong>是否授权登录:</strong> 是
<strong>简要描述:</strong>
登录api,会把之前登录者踢出会话.一个帐号只允许一个用户登录,json对象放在body里面,token有效期为一天</p>
<p><strong>参数:</strong></p>
<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;">appKey</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">String</td>
<td>登录的appkey,在[玩瞳控制台](<a href="https://console.51wanxue.com/showLogin.do">https://console.51wanxue.com/showLogin.do</a> "玩瞳控制台")的【应用管理】-【成为开发者】模块获取</td>
</tr>
<tr>
<td style="text-align: left;">appSecret</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">String</td>
<td>登录的appsecret ,在玩瞳控制台的【系统管理】-【成为开发者】模块获取</td>
</tr>
<tr>
<td style="text-align: left;">encrypt</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">boolean</td>
<td>是否使用对appSecret进行加密的传输登录,如需进行加密传输请先调用[【进行加密传输】](<a href="https://www.showdoc.com.cn/visiontalk?page_id=2457991222509574">https://www.showdoc.com.cn/visiontalk?page_id=2457991222509574</a> "【】")</td>
</tr>
</tbody>
</table>
<p><strong>备注</strong>:
1.参数是json对象。</p>
<p><strong>返回示例</strong></p>
<pre><code class="language-json">入参示例
{
&quot;appKey&quot;: &quot;2b1162c8-0aa8-4a32-8836-5d175e5f8ffa&quot;,
&quot;appSecret&quot;: &quot;e3a6d8c5-bb1b-4b21-afaf-ac1d5d8b8648&quot;,
&quot;encrypt&quot;: false
}
查询成功示例
{
&quot;code&quot;: 0,
&quot;msg&quot;: &quot;ok&quot;,
&quot;data&quot;: {
&quot;token&quot;: &quot;asfsdefasfsdgdfghfhf&quot;
}
}
查询失败示例
{
&quot;code&quot;: 1001,
&quot;msg&quot;: &quot;apiKey does not exist&quot;,
&quot;data&quot;: null
}</code></pre>
<p><strong>返回数据参数说明 </strong></p>
<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;">code</td>
<td style="text-align: left;">int</td>
<td>请求返回码 0(表示成功)</td>
</tr>
<tr>
<td style="text-align: left;">msg</td>
<td style="text-align: left;">String</td>
<td>系统返回提示</td>
</tr>
<tr>
<td style="text-align: left;">data</td>
<td style="text-align: left;">Object</td>
<td>返回数据</td>
</tr>
</tbody>
</table>
<p><strong>token </strong></p>
<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;">token</td>
<td style="text-align: left;">String</td>
<td>登录成功后的返回的token,以后每次请求都必须携带该token,可放header 或 URI</td>
</tr>
</tbody>
</table>