chong

Updates 用户鉴权/README.md

Auto commit by GitBook Editor
1 -#boxfish用户认证系统 1 +# boxfish用户认证系统
2 2
3 -####部署地址 3 +#### 部署地址
4 -http://114.55.58.184:8099/  
5 4
6 -####认证接口 /user/auth 5 +[http://114.55.58.184:8099/](http://114.55.58.184:8099/)
7 6
8 -####请求方式 7 +#### 认证接口 /user/auth
9 - POST 方法 8 +
10 -####请求头信息 9 +#### 请求方式
11 -x-be-product com.boxfishedu.teacher (必须包含 teacher or student ) 10 +
  11 +POST 方法
  12 +
  13 +#### 请求头信息
  14 +
  15 +x-be-product com.boxfishedu.teacher \(必须包含 teacher or student \)
12 16
13 #### 请求参数 17 #### 请求参数
14 -- json 18 +
15 - ```json 19 +* json
16 - { 20 + ```json
  21 + {
17 "username":"username", 22 "username":"username",
18 "password":"password" 23 "password":"password"
19 - } 24 + }
20 - ``` 25 + ```
21 26
22 #### 返回值 27 #### 返回值
23 -- 合法用户 28 +
  29 +* 合法用户
24 http code 200 30 http code 200
25 - ```json 31 +
26 - { 32 + ```json
  33 + {
27 "id": 7566, 34 "id": 7566,
28 "username": "b@b.cn", 35 "username": "b@b.cn",
29 "access_token": "futT9nmvb5", 36 "access_token": "futT9nmvb5",
30 "score":3801, 37 "score":3801,
31 "goal":100, 38 "goal":100,
32 "figure_url":"http://avatars.boxfish.cn/user/-12/figure/1411532427.jpg" 39 "figure_url":"http://avatars.boxfish.cn/user/-12/figure/1411532427.jpg"
33 - } 40 + }
34 - ``` 41 + ```
35 42
36 -- 用户不存在 43 +* 用户不存在
37 http code 404 44 http code 404
38 - ```json 45 +
39 - { 46 + ```json
  47 + {
40 "msg": "用户不存在!" 48 "msg": "用户不存在!"
41 - } 49 + }
42 - ``` 50 + ```
43 51
44 - - 用户密码不正确 52 + 用户密码不正确
45 - http code 401  
46 - ```json  
47 - {  
48 - "msg":"用户密码不正确!"  
49 - }  
50 - ```  
51 53
52 -- 用户不合法 用户头信息中 和用户账号类型不匹配 54 + http code 401
  55 + ```json
  56 + {
  57 + "msg":"用户密码不正确!"
  58 + }
  59 + ```
  60 +
  61 +* 用户不合法 用户头信息中 和用户账号类型不匹配
53 http code 412 62 http code 412
54 - ```json 63 +
55 - { 64 + ```json
  65 + {
56 "msg":"用户不合法" 66 "msg":"用户不合法"
57 } 67 }
58 - ``` 68 + ```
59 69
60 -####用户信息接口 /user/me 70 +#### 用户信息接口 /user/me
61 71
62 -####URL参数 72 +#### URL参数
63 - - access_token string 必须  
64 73
65 -####请求方式 74 +* access\_token string 必须
66 - GET 方法 75 +
  76 +#### 请求方式
  77 +
  78 +GET 方法
67 79
68 #### 返回值 80 #### 返回值
69 -- 合法用户 81 +
  82 +* 合法用户
70 http code 200 83 http code 200
71 - ```json 84 +
72 - { 85 + ```json
  86 + {
73 "id": 7566, 87 "id": 7566,
74 "username": "b@b.cn", 88 "username": "b@b.cn",
75 "access_token": "futT9nmvb5", 89 "access_token": "futT9nmvb5",
@@ -78,37 +92,44 @@ x-be-product com.boxfishedu.teacher (必须包含 teacher or student ) @@ -78,37 +92,44 @@ x-be-product com.boxfishedu.teacher (必须包含 teacher or student )
78 "figure_url":"http://avatars.boxfish.cn/user/-12/figure/1411532427.jpg" 92 "figure_url":"http://avatars.boxfish.cn/user/-12/figure/1411532427.jpg"
79 93
80 } 94 }
81 - ``` 95 + ```
82 -- accessToken 不合法 96 +
  97 +* accessToken 不合法
83 98
84 http code 400 99 http code 400
85 - ``` json 100 +
  101 + ```json
86 { 102 {
87 "msg": "accessToken 不合法!" 103 "msg": "accessToken 不合法!"
88 } 104 }
89 - ``` 105 + ```
90 106
91 -- 用户不存在 107 +* 用户不存在
92 http code 404 108 http code 404
93 - ```json 109 +
94 - { 110 + ```json
  111 + {
95 "msg": "用户不存在!" 112 "msg": "用户不存在!"
96 } 113 }
97 - ``` 114 + ```
98 -####用户信息接口 /relation/user/{user_id}?access_token={access_token} 115 +
  116 + #### 用户信息接口 /relation/user/{user\_id}?access\_token={access\_token}
  117 +
  118 +#### URL参数
99 119
100 -####URL参数 120 +* user\_id Long 必须
101 - - user_id Long 必须 121 +* access\_token string 必须
102 - - access_token string 必须  
103 122
104 -####请求方式 123 +#### 请求方式
105 - GET 方法 124 +
  125 +GET 方法
106 126
107 #### 返回值 127 #### 返回值
108 -- 用户关系合法 128 +
  129 +* 用户关系合法
109 http code 200 130 http code 200
110 - ```json 131 + ```json
111 - { 132 + {
112 "id": 100000000640, 133 "id": 100000000640,
113 "target": { 134 "target": {
114 "id": 1298963, 135 "id": 1298963,
@@ -118,28 +139,35 @@ x-be-product com.boxfishedu.teacher (必须包含 teacher or student ) @@ -118,28 +139,35 @@ x-be-product com.boxfishedu.teacher (必须包含 teacher or student )
118 "figure_url": "http://avatars.boxfish.cn/user/1298963/figure/1477366527.jpg" 139 "figure_url": "http://avatars.boxfish.cn/user/1298963/figure/1477366527.jpg"
119 } 140 }
120 } 141 }
121 - ``` 142 + ```
122 -- accessToken 不合法 143 +* accessToken 不合法
123 144
124 http code 400 145 http code 400
125 - ``` json 146 +
  147 + ```json
126 { 148 {
127 "msg": "accessToken 不合法!" 149 "msg": "accessToken 不合法!"
128 } 150 }
129 - ``` 151 + ```
130 -- accessToken 过期 152 +
  153 +* accessToken 过期
131 154
132 http code 401 155 http code 401
133 - ``` json 156 +
  157 + ```json
134 { 158 {
135 "msg": "用户token过期!" 159 "msg": "用户token过期!"
136 } 160 }
137 - ``` 161 + ```
138 162
139 -- 该用户没有绑定其它用户! 163 +* 该用户没有绑定其它用户!
140 http code 404 164 http code 404
141 - ```json 165 +
142 - { 166 + ```json
  167 + {
143 "msg": "该用户没有绑定其它用户!" 168 "msg": "该用户没有绑定其它用户!"
144 } 169 }
145 - ``` 170 + ```
  171 +
  172 +
  173 +