Files
digital-pilates/services/users.ts
richarjiang e3e2f1b8c6 feat: 优化 AI 教练聊天和打卡功能
- 在 AI 教练聊天界面中添加会话缓存功能,支持冷启动时恢复聊天记录
- 实现轻量防抖机制,确保会话变动时及时保存缓存
- 在打卡功能中集成按月加载打卡记录,提升用户体验
- 更新 Redux 状态管理,支持打卡记录的按月加载和缓存
- 新增打卡日历页面,允许用户查看每日打卡记录
- 优化样式以适应新功能的展示和交互
2025-08-14 09:57:13 +08:00

24 lines
575 B
TypeScript
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.

import { api } from '@/services/api';
export type Gender = 'male' | 'female';
export type UpdateUserDto = {
userId: string;
name?: string;
avatar?: string; // base64 字符串
gender?: Gender;
birthDate?: number; // 时间戳(秒)
dailyStepsGoal?: number;
dailyCaloriesGoal?: number;
pilatesPurposes?: string[];
weight?: number;
height?: number;
};
export async function updateUser(dto: UpdateUserDto): Promise<Record<string, any>> {
// 固定使用后端文档接口PUT /api/users/update
return await api.put('/api/users/update', dto);
}