Dining_Hall/api/system/user.js

41 lines
792 B
JavaScript
Raw Normal View History

2024-12-17 09:13:52 +08:00
import upload from '@/utils/upload'
import request from '@/utils/request'
// 用户密码重置
2025-01-16 11:09:35 +08:00
export function updateUserPwd(password) {
2024-12-17 09:13:52 +08:00
const data = {
2025-01-16 11:09:35 +08:00
password
2024-12-17 09:13:52 +08:00
}
return request({
2025-01-16 11:09:35 +08:00
url: '/system/user/confirmPassword',
method: 'post',
2024-12-17 09:13:52 +08:00
params: data
})
}
// 查询用户个人信息
export function getUserProfile() {
return request({
2025-01-16 11:09:35 +08:00
url: '/system/user/getInfo',
2024-12-17 09:13:52 +08:00
method: 'get'
})
}
// 修改用户个人信息
export function updateUserProfile(data) {
return request({
2025-01-16 11:09:35 +08:00
url: '/system/user/edit',
method: 'post',
2024-12-17 09:13:52 +08:00
data: data
})
}
// 用户头像上传
export function uploadAvatar(data) {
return upload({
url: '/system/user/profile/avatar',
name: data.name,
filePath: data.filePath
})
}