bootcamp documentation - JokerHai/boot_camp_mall GitHub Wiki
1. 用户管理
1.1注册
1.2登录
接口地址:
URL地址: /authorizations/
http请求方式:
POST
请求参数:
JSON 或 表单
参数名 | 类型 | 是否必须 | 说明 |
---|---|---|---|
username | str | 是 | 用户名 |
password | str | 是 | 密码 |
返回示例:
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjozMiwidXNlcm5hbWUiOiJqb2tlciIsImV4cCI6MTU0ODgyODQzNiwiZW1haWwiOiIifQ.peaVd7dU2XJ-XPie82zTKwzKhWyy8VGi4F21EDW6H4w",
"user_id": 32,
"username": "joker"
}
错误示例:
{
"username": [
"该字段不能为空。"
]
}
1.2.1 获取QQ登录地址
接口链接
URL地址:/oauth/qq/authorization/?next=xxx
http请求方式:
GET
请求参数
参数名 | 类型 | 是否必须 | 说明 |
---|---|---|---|
net | str | 否 | 用户QQ登录成功后进入爱美丽商城的地址 |
返回说明
{
"login_url": "https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=101474184&redirect_uri=http%3A%2F%2Fwww.meiduo.site%3A8080%2Foauth_callback.html&state=%2F&scope=get_user_info"
}
1.3获取用户信息
接口链接
URL地址:/user/
http:请求方式:
GET
请求参数
请求头 headers:
key: Authorization
value: JWT 空格 JWTToken
说明:
JWTToken 从登陆接口获取
返回数据
返回值 | 类型 | 是否必须 | 说明 |
---|---|---|---|
id | int | 是 | 用户ID |
username | str | 是 | 用户名 |
mobile | str | 是 | 手机号 |
str | 是 | email邮箱 | |
email_active | bool | 是 | 邮箱是否通过验证 |
返回实例
{
"id": 32,
"username": "joker",
"mobile": "15011390890",
"email": "",
"email_active": false
}
2.商品管理