Files
rd_mes_uniapp/api/system/user.js

48 lines
860 B
JavaScript
Raw Permalink Normal View History

2025-12-18 14:11:48 +08:00
import upload from '@/utils/upload'
import request from '@/utils/request'
// 用户密码重置
export function updateUserPwd(oldPassword, newPassword) {
2026-01-06 17:04:59 +08:00
const data = {
oldPassword,
newPassword
}
return request({
url: '/system/user/profile/updatePwd',
method: 'put',
params: data
})
2025-12-18 14:11:48 +08:00
}
// 查询用户个人信息
export function getUserProfile() {
2026-01-06 17:04:59 +08:00
return request({
url: '/system/user/profile',
method: 'get'
})
2025-12-18 14:11:48 +08:00
}
// 修改用户个人信息
export function updateUserProfile(data) {
2026-01-06 17:04:59 +08:00
return request({
url: '/system/user/profile',
method: 'put',
data: data
})
2025-12-18 14:11:48 +08:00
}
// 用户头像上传
export function uploadAvatar(data) {
2026-01-06 17:04:59 +08:00
return upload({
url: '/system/user/profile/avatar',
name: data.name,
filePath: data.filePath
})
2025-12-18 14:11:48 +08:00
}
2026-01-06 17:04:59 +08:00
export function getUserInfo(id) {
return request({
url: '/system/user/' + id,
method: 'get'
})
}