/** * 用户模块 API */ import http from '@/utils/http' /** * 获取当前用户个人资料 * @returns {Promise<{userId, nickname, avatar, phone, appId}>} */ export function getProfile() { return http.get('/app/user/profile') } /** * 修改当前用户个人资料(昵称、头像) * @param {Object} data - { nickname?, avatar? } */ export function updateProfile(data) { return http.put('/app/user/profile', data) } /** * 上传头像图片到 OSS * @param {string} filePath - 本地图片临时路径 * @returns {Promise<{url: string}>} OSS 公网访问 URL */ export function uploadAvatar(filePath) { return http.upload('/file/image', { filePath }) }