-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_info_ext.html
121 lines (120 loc) · 2.7 KB
/
user_info_ext.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<link href="http://statics.1024tools.com/css/markdown/github.css" rel="stylesheet" />
<h1 id="-">获取用户信息</h1>
<h2 id="url-http-tst-candy-one-api-user-1-0-0-authorization-user-info">url <a href="http://tst.candy.one/api/user/1.0.0/authorization-user-info">http://tst.candy.one/api/user/1.0.0/authorization-user-info</a></h2>
<h2 id="-get">请求方式: Get</h2>
<h3 id="-">头列表</h3>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>是否必填</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>authorization</td>
<td>String</td>
<td>是</td>
<td>Bearer加空格加授权的token,例如 "Bearer 21795f65-d8db-4b1a-a27e-cbebc08fcb11"</td>
</tr>
</tbody>
</table>
<h3 id="-">参数列表</h3>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>是否必填</th>
<th>参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>clientId</td>
<td>String</td>
<td>是</td>
<td>第三方client id</td>
</tr>
<tr>
<td>sign</td>
<td>String</td>
<td>是</td>
<td>第三方参数签名</td>
</tr>
</tbody>
</table>
<h3 id="-">签名算法</h3>
<p> 参数名ASCII码从小到大排序,最后拼接上第三方的key得到一个字符串,然后对这个字符串md5,得到签名字段。示例代码如下。</p>
<pre><code>{
String parmas = "clientId=client&token=5e261464-d9aa-4d5c-82a4-2ddea750a699&key=aeofijslkadfoiwejfa";
String sign = md5(params);
}
</code></pre><h2 id="-">响应</h2>
<p><strong>同步返回</strong></p>
<pre><code class="lang-javascript">{
"code":1,
"data":{
"avatar":"https://static.tinfinite.com/candy/dync/2941922_1541064461852_0",
"nickName":"大漠斜阳西风烈酒",
"phoneNum":"8613717536713",
"openId":"1fea115e7e39432a20e0b9be46700f72"
}
}
{
"code":0,
"err":{
"err_code":10076,
"message":"签名错误"
}
}
</code></pre>
<h3 id="-">返回值</h3>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>返回值类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>int</td>
<td>1为成功,0为失败</td>
</tr>
<tr>
<td>avatar</td>
<td>String</td>
<td>用户头像url</td>
</tr>
<tr>
<td>nickName</td>
<td>String</td>
<td>用户昵称</td>
</tr>
<tr>
<td>phoneNum</td>
<td>String</td>
<td>用户手机号,如果授权范围不符合,这个字段不会有</td>
</tr>
<tr>
<td>openId</td>
<td>String</td>
<td>用户在第三方平台的open id</td>
</tr>
<tr>
<td>err_code</td>
<td>int</td>
<td>错误码</td>
</tr>
<tr>
<td>message</td>
<td>String</td>
<td>错误描述</td>
</tr>
</tbody>
</table>