edit
This commit is contained in:
parent
1991b4f912
commit
086b8b85d3
@ -1,11 +1,11 @@
|
|||||||
# RESTFul API 文档 v1.0
|
# RESTFul API 文档 v1.0
|
||||||
|
|
||||||
## 1. 用户注册
|
## 1. 用户登录接口
|
||||||
|
|
||||||
### 1.1 接口描述
|
### 1.1 接口描述
|
||||||
用户输入账号、邮箱、密码完成注册。
|
用户输入账号、密码完成登录。
|
||||||
### 1.2 请求URL
|
### 1.2 请求URL
|
||||||
`/v1/auth/register`
|
`/v1/auth/login`
|
||||||
|
|
||||||
### 1.3 请求方式
|
### 1.3 请求方式
|
||||||
**POST**
|
**POST**
|
||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
### 1.6 请求示例
|
### 1.6 请求示例
|
||||||
```http
|
```http
|
||||||
POST /api/user/signup
|
POST /v1/auth/login
|
||||||
Host: {apiAddress}
|
Host: {apiAddress}
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
@ -42,14 +42,20 @@ Content-Type: application/json
|
|||||||
| data | 否 | json | | 具体业务数据 |
|
| data | 否 | json | | 具体业务数据 |
|
||||||
|
|
||||||
|
|
||||||
|
data结构说明:
|
||||||
|
|
||||||
|
| 参数名称 | 必填 | 数据类型 | 约束条件 | 描述 |
|
||||||
|
|-------| ---- | -------- |------|-----------|
|
||||||
|
| token | 是 | 字符串 | 字符串 | jwt token |
|
||||||
|
|
||||||
### 1.8 响应示例(成功)
|
### 1.8 响应示例(成功)
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{"code":0,"msg":"success","data":{"id":100067,"username":"a123"}}
|
{"code":0,"msg":"success","data":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhMTIzIiwiaWF0IjoxNjg3NjQyNzU4LCJleHAiOjE2ODc2Njg3NTgsIm5iZiI6MTY4Nz"}}
|
||||||
```
|
```
|
||||||
### 1.9 响应示例(错误)
|
### 1.9 响应示例(错误)
|
||||||
```json
|
```json
|
||||||
{ "code": 10001, "message": "验证码无效" }
|
{ "code": 10001, "msg": "验证失败" }
|
||||||
```
|
```
|
||||||
|
|
||||||
### 1.10 错误响应码参考
|
### 1.10 错误响应码参考
|
||||||
|
Loading…
Reference in New Issue
Block a user