| 1234567891011121314151617181920212223242526272829 |
- /**
- * 用户模块 API
- */
- import http from '@/utils/http'
- /**
- * 获取当前用户个人资料
- * @returns {Promise<Object>} 当前账号与完整用户档案信息
- */
- export function getProfile() {
- return http.get('/app/user/profile')
- }
- /**
- * 修改当前用户个人资料
- * @param {Object} data - 昵称、头像及用户档案字段
- */
- 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 })
- }
|