zhibo/android-app/后端接口TODO清单-用户认证.md

61 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 后端接口 TODO 清单 - 用户认证模块
## 1. 用户登录
**文件**: `LoginActivity.java`
**接口路径**: `POST /api/front/login`
**请求参数**:
```json
{
"account": "string", // 账号(手机号或用户名)
"password": "string" // 密码
}
```
**返回数据**:
```json
{
"code": 200,
"message": "success",
"data": {
"token": "string", // JWT token
"userId": "string", // 用户ID
"nickname": "string", // 昵称
"avatarUrl": "string" // 头像URL可选
}
}
```
## 2. 用户注册
**文件**: `RegisterActivity.java`
**接口路径**: `POST /api/front/register`
**请求参数**:
```json
{
"phone": "string", // 手机号
"password": "string", // 密码
"verificationCode": "string", // 验证码
"nickname": "string" // 昵称(可选)
}
```
**返回数据**: 同登录接口
## 3. 发送验证码
**文件**: `RegisterActivity.java`
**接口路径**: `POST /api/sms/send`
**请求参数**:
```json
{
"phone": "string", // 手机号
"type": "register" // 类型register/reset_password
}
```
**返回数据**:
```json
{
"code": 200,
"message": "验证码已发送",
"data": {
"success": true
}
}
```