用户信息
<p>[TOC]</p>
<h3>功能介绍:</h3>
<ul>
<li>通过用户id或用户code或用登录名或当前用户信息</li>
</ul>
<h3>接口约束:</h3>
<ul>
<li>无</li>
</ul>
<h3>URI:</h3>
<p>当前用户:
<code>GET {{baseUrl}}/auth/authentication/user/current</code>
用户id:
<code>GET {{baseUrl}}/auth/authentication/user/userid/{userid}</code>
<code>GET {{baseUrl}}/auth/authentication/user?userid={userid}</code>
用户code:
<code>GET {{baseUrl}}/auth/authentication/user/usercode/{userCode}</code>
<code>GET {{baseUrl}}/auth/authentication/user?userCode={userCode}</code>
用户登录名:
<code>GET {{baseUrl}}/auth/authentication/user/loginname/{loginname}</code>
<code>GET {{baseUrl}}/auth/authentication/user?loginname={loginname}</code></p>
<h3>请求消息:</h3>
<p><strong>请求头</strong>
请求头如表1所示。
表1 请求参数:</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;">sobeycloud-token</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>用户token</td>
</tr>
<tr>
<td style="text-align: left;">sobeycloud-site</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">string</td>
<td>用户站点(签名方式必填)</td>
</tr>
</tbody>
</table>
<p><strong>请求参数</strong>
请求参数如表2所示。</p>
<p>表2 请求参数:</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;">userid</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>用户id</td>
</tr>
<tr>
<td style="text-align: left;">userCode</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>用户code</td>
</tr>
<tr>
<td style="text-align: left;">loginname</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>登录名</td>
</tr>
</tbody>
</table>
<h3>请求示例:</h3>
<pre><code>GET /auth/authentication/user?userid=7
sobeycloud-site: S1
sobeycloud-token: SjUAxwMUwkpuY+CNt1daEMoVAVE= </code></pre>
<hr />
<h3>响应消息:</h3>
<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;">--</td>
<td style="text-align: left;">--</td>
<td>--</td>
</tr>
</tbody>
</table>
<h3>响应示例:</h3>
<p><strong>响应成功示例</strong> </p>
<pre><code> {
"code": "0",
"msg": null,
"ext": {
"avatarurl": null,
"createtime": "2021-09-01 08:19:03",
"disabled": 0,
"email": null,
"extendattributs": null,
"groups": [
{
"canDelete": true,
"canExecute": true,
"canRead": true,
"canWrite": true,
"groupCode": "owner_2a56c691e71543a8968dc033827f4274",
"groupName": "owner_2a56c691e71543a8968dc033827f4274",
"level": "15"
}
],
"id": 7,
"link": null,
"loginname": "lj",
"nickname": null,
"oldpassword": null,
"operate": 0,
"organizations": [],
"parentid": null,
"password": null,
"permissions": [
{
"candelete": true,
"canexecute": true,
"canread": true,
"canwrite": true,
"level": 15,
"templatecode": "private_2a56c691e71543a8968dc033827f4274",
"templatename": "private_2a56c691e71543a8968dc033827f4274"
},
{
"candelete": true,
"canexecute": true,
"canread": true,
"canwrite": true,
"level": 15,
"templatecode": "default_550dcf92bd034039a9abae1ec5e3faa1",
"templatename": "default_550dcf92bd034039a9abae1ec5e3faa1"
},
{
"candelete": true,
"canexecute": true,
"canread": true,
"canwrite": true,
"level": 15,
"templatecode": "public_ff44e78e8372491dbccc9bae4f874900",
"templatename": "public_ff44e78e8372491dbccc9bae4f874900"
},
{
"candelete": true,
"canexecute": true,
"canread": true,
"canwrite": true,
"level": 15,
"templatecode": "owner_2a56c691e71543a8968dc033827f4274",
"templatename": "owner_2a56c691e71543a8968dc033827f4274"
}
],
"phone": null,
"pwdchangetime": "2021-09-01 08:19:03",
"roles": [
{
"count": 0,
"description": null,
"disabled": 0,
"id": null,
"extendAttributes": null,
"privilegeadmin": 0,
"rolecode": "admin_49e00306c8784d82b8a10b8f519c6423",
"rolename": "default_hive_admin",
"roletype": 1,
"sitecode": null,
"sitename": null
}
],
"s3accesskeyid": null,
"s3secretkey": null,
"sitecode": "ff44e78e8372491dbccc9bae4f874900",
"sitename": null,
"sitetype": 0,
"storagesize": null,
"storageusage": null,
"storagewarningpct": null,
"templates": null,
"type": 1,
"usercode": "2a56c691e71543a8968dc033827f4274",
"usertoken": null,
"funcPermission": null
}
}</code></pre>
<p><strong>响应失败示例</strong> </p>
<pre><code> {
"code": "Auth.0014",
"msg": "系统内部错误"
}</code></pre>
<hr />
<h3>错误码</h3>
<p>参考 <a href="https://www.showdoc.com.cn/mbhauth/7655637558569867" title="错误码说明">错误码说明</a></p>
<h3>状态码</h3>
<p>参考 <a href="https://www.showdoc.com.cn/mbhauth/7655637558569867" title="状态码说明">状态码说明</a></p>