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
2017-01-03 17:42:24 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
d4a654ebe8644785473d3483d929470bee382dc6
d4a654eb
2 parents
75c16659
cf22b45f
Merge branch master
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
178 additions
and
0 deletions
SUMMARY.md
用户鉴权/README.md
SUMMARY.md
View file @
d4a654e
This diff is collapsed. Click to expand it.
用户鉴权/README.md
0 → 100644
View file @
d4a654e
# boxfish用户认证系统
#### 测试环境部署地址
[
http://114.55.58.184:8099/
](
http://114.55.58.184:8099/
)
#### 生产环境部署地址
[
http\(s\)//base.boxfish.cn/passbook/
](
http://base.boxfish.cn/passbook/
)
认证接口 /user/auth
#### 请求方式
POST 方法
#### 请求头信息
x-be-product com.boxfishedu.teacher
\(
必须包含 teacher or student
\)
#### 请求参数
*
json
```
json
{
"username"
:
"username"
,
"password"
:
"password"
}
```
#### 返回值
*
合法用户
http code 200
```
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
{
"msg"
:
"用户不存在!"
}
```
*
用户密码不正确
http code 401
```
json
{
"msg"
:
"用户密码不正确!"
}
```
*
用户不合法 用户头信息中 和用户账号类型不匹配
http code 412
```
json
{
"msg"
:
"用户不合法"
}
```
#### 用户信息接口 /user/me
#### URL参数
*
access
\_
token string 必须
#### 请求方式
GET 方法
#### 返回值
*
合法用户
http code 200
```
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"
}
```
*
accessToken 不合法
http code 400
```
json
{
"msg"
:
"accessToken 不合法!"
}
```
*
用户不存在
http code 404
```
json
{
"msg"
:
"用户不存在!"
}
```
#### 用户信息接口 /relation/user/{user
\_
id}?access
\_
token={access
\_
token}
#### URL参数
*
user
\_
id Long 必须
*
access
\_
token string 必须
#### 请求方式
GET 方法
#### 返回值
*
用户关系合法
http code 200
```
json
{
"id"
:
100000000640
,
"target"
:
{
"id"
:
1298963
,
"username"
:
"iosstudent13@bf.cn"
,
"score"
:
3912
,
"gold"
:
2362
,
"figure_url"
:
"http://avatars.boxfish.cn/user/1298963/figure/1477366527.jpg"
}
}
```
*
accessToken 不合法
http code 400
```
json
{
"msg"
:
"accessToken 不合法!"
}
```
*
accessToken 过期
http code 401
```
json
{
"msg"
:
"用户token过期!"
}
```
*
该用户没有绑定其它用户!
http code 404
```
json
{
"msg"
:
"该用户没有绑定其它用户!"
}
```
...
...
Please
register
or
login
to post a comment