feat: 添加mock数据
This commit is contained in:
@@ -768,6 +768,97 @@ export const accountHandlers = [
|
||||
});
|
||||
}),
|
||||
|
||||
// ==================== 账号绑定管理 ====================
|
||||
|
||||
// 手机号发送验证码
|
||||
http.post('/api/account/phone/send-code', async ({ request }) => {
|
||||
await delay(NETWORK_DELAY);
|
||||
const body = await request.json();
|
||||
console.log('[Mock] 发送手机验证码:', body.phone);
|
||||
return HttpResponse.json({
|
||||
success: true,
|
||||
message: '验证码已发送'
|
||||
});
|
||||
}),
|
||||
|
||||
// 手机号绑定
|
||||
http.post('/api/account/phone/bind', async ({ request }) => {
|
||||
await delay(NETWORK_DELAY);
|
||||
const body = await request.json();
|
||||
console.log('[Mock] 绑定手机号:', body.phone);
|
||||
return HttpResponse.json({
|
||||
success: true,
|
||||
message: '手机号绑定成功',
|
||||
data: { phone: body.phone, phone_confirmed: true }
|
||||
});
|
||||
}),
|
||||
|
||||
// 手机号解绑
|
||||
http.post('/api/account/phone/unbind', async () => {
|
||||
await delay(NETWORK_DELAY);
|
||||
console.log('[Mock] 解绑手机号');
|
||||
return HttpResponse.json({
|
||||
success: true,
|
||||
message: '手机号解绑成功'
|
||||
});
|
||||
}),
|
||||
|
||||
// 邮箱发送验证码
|
||||
http.post('/api/account/email/send-bind-code', async ({ request }) => {
|
||||
await delay(NETWORK_DELAY);
|
||||
const body = await request.json();
|
||||
console.log('[Mock] 发送邮箱验证码:', body.email);
|
||||
return HttpResponse.json({
|
||||
success: true,
|
||||
message: '验证码已发送'
|
||||
});
|
||||
}),
|
||||
|
||||
// 邮箱绑定
|
||||
http.post('/api/account/email/bind', async ({ request }) => {
|
||||
await delay(NETWORK_DELAY);
|
||||
const body = await request.json();
|
||||
console.log('[Mock] 绑定邮箱:', body.email);
|
||||
return HttpResponse.json({
|
||||
success: true,
|
||||
message: '邮箱绑定成功',
|
||||
user: { email: body.email, email_confirmed: true }
|
||||
});
|
||||
}),
|
||||
|
||||
// 微信获取二维码
|
||||
http.get('/api/account/wechat/qrcode', async () => {
|
||||
await delay(NETWORK_DELAY);
|
||||
console.log('[Mock] 获取微信绑定二维码');
|
||||
return HttpResponse.json({
|
||||
success: true,
|
||||
auth_url: 'https://open.weixin.qq.com/connect/qrconnect?mock=true',
|
||||
session_id: 'mock_session_' + Date.now()
|
||||
});
|
||||
}),
|
||||
|
||||
// 微信绑定检查
|
||||
http.post('/api/account/wechat/check', async ({ request }) => {
|
||||
await delay(NETWORK_DELAY);
|
||||
const body = await request.json();
|
||||
console.log('[Mock] 检查微信绑定状态:', body.session_id);
|
||||
// 模拟绑定成功
|
||||
return HttpResponse.json({
|
||||
success: true,
|
||||
status: 'bind_ready'
|
||||
});
|
||||
}),
|
||||
|
||||
// 微信解绑
|
||||
http.post('/api/account/wechat/unbind', async () => {
|
||||
await delay(NETWORK_DELAY);
|
||||
console.log('[Mock] 解绑微信');
|
||||
return HttpResponse.json({
|
||||
success: true,
|
||||
message: '微信解绑成功'
|
||||
});
|
||||
}),
|
||||
|
||||
// 21. 获取订阅套餐列表
|
||||
http.get('/api/subscription/plans', async () => {
|
||||
await delay(NETWORK_DELAY);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user