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