Toggle navigation
Toggle navigation
This project
Loading...
Sign in
liuming
/
developer-docs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
chong
2016-12-24 17:01:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c2e7e64276a54837ed238182fbf33481873a07c2
c2e7e642
1 parent
aab37970
Updates 用户鉴权/README.md
Auto commit by GitBook Editor
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
70 deletions
用户鉴权/README.md
用户鉴权/README.md
View file @
c2e7e64
#boxfish用户认证系统
#
boxfish用户认证系统
####部署地址
http://114.55.58.184:8099/
#### 部署地址
####认证接口 /user/auth
[
http://114.55.58.184:8099/
](
http://114.55.58.184:8099/
)
####请求方式
POST 方法
####请求头信息
x-be-product com.boxfishedu.teacher (必须包含 teacher or student )
#### 认证接口 /user/auth
#### 请求方式
POST 方法
#### 请求头信息
x-be-product com.boxfishedu.teacher
\(
必须包含 teacher or student
\)
#### 请求参数
-
json
```
json
{
*
json
```
json
{
"username"
:
"username"
,
"password"
:
"password"
}
```
}
```
#### 返回值
-
合法用户
*
合法用户
http code 200
```
json
{
```
json
{
"id"
:
7566
,
"username"
:
"b@b.cn"
,
"access_token"
:
"futT9nmvb5"
,
"score"
:
3801
,
"goal"
:
100
,
"figure_url"
:
"http://avatars.boxfish.cn/user/-12/figure/1411532427.jpg"
}
```
}
```
-
用户不存在
*
用户不存在
http code 404
```
json
{
```
json
{
"msg"
:
"用户不存在!"
}
```
}
```
-
用户密码不正确
http code 401
```
json
{
"msg"
:
"用户密码不正确!"
}
```
用户密码不正确
-
用户不合法 用户头信息中 和用户账号类型不匹配
http code 401
```
json
{
"msg":"用户密码不正确!"
}
```
* 用户不合法 用户头信息中 和用户账号类型不匹配
http code 412
```
json
{
```
json
{
"msg":"用户不合法"
}
```
```
####用户信息接口 /user/me
####
用户信息接口 /user/me
####URL参数
-
access_token string 必须
#### URL参数
####请求方式
GET 方法
* access\_token string 必须
#### 请求方式
GET 方法
#### 返回值
-
合法用户
* 合法用户
http code 200
```
json
{
```
json
{
"id": 7566,
"username": "b@b.cn",
"access_token": "futT9nmvb5",
...
...
@@ -78,37 +92,44 @@ x-be-product com.boxfishedu.teacher (必须包含 teacher or student )
"figure_url":"http://avatars.boxfish.cn/user/-12/figure/1411532427.jpg"
}
```
-
accessToken 不合法
```
*
accessToken 不合法
http code 400
```
json
```
json
{
"msg"
:
"accessToken 不合法!"
}
```
```
-
用户不存在
*
用户不存在
http code 404
```
json
{
```
json
{
"msg"
:
"用户不存在!"
}
```
####用户信息接口 /relation/user/{user_id}?access_token={access_token}
```
#### 用户信息接口 /relation/user/{user
\_
id}?access
\_
token={access
\_
token}
#### URL参数
####URL参数
-
user_id Long 必须
-
access_token string 必须
*
user
\_
id Long 必须
*
access
\_
token string 必须
####请求方式
GET 方法
#### 请求方式
GET 方法
#### 返回值
-
用户关系合法
*
用户关系合法
http code 200
```
json
{
```
json
{
"id"
:
100000000640
,
"target"
:
{
"id"
:
1298963
,
...
...
@@ -118,28 +139,35 @@ x-be-product com.boxfishedu.teacher (必须包含 teacher or student )
"figure_url"
:
"http://avatars.boxfish.cn/user/1298963/figure/1477366527.jpg"
}
}
```
-
accessToken 不合法
```
*
accessToken 不合法
http code 400
```
json
```
json
{
"msg"
:
"accessToken 不合法!"
}
```
-
accessToken 过期
```
*
accessToken 过期
http code 401
```
json
```
json
{
"msg"
:
"用户token过期!"
}
```
```
-
该用户没有绑定其它用户!
*
该用户没有绑定其它用户!
http code 404
```
json
{
```
json
{
"msg"
:
"该用户没有绑定其它用户!"
}
```
```
...
...
Please
register
or
login
to post a comment