2024-09-18 10:30:10 +08:00
|
|
|
import upload from '@/utils/upload'
|
|
|
|
import request from '@/utils/request'
|
|
|
|
|
|
|
|
// 用户密码重置
|
|
|
|
export function updateUserPwd(oldPassword, newPassword) {
|
|
|
|
const data = {
|
|
|
|
oldPassword,
|
|
|
|
newPassword
|
|
|
|
}
|
|
|
|
return request({
|
2024-11-22 17:29:55 +08:00
|
|
|
url: '/system/user/resetPwd',
|
2024-09-18 10:30:10 +08:00
|
|
|
method: 'put',
|
|
|
|
params: data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-11-22 17:29:55 +08:00
|
|
|
//重置密码
|
|
|
|
export function userResetPwd(data) {
|
|
|
|
return request({
|
|
|
|
url: "/system/user/resetPwd",
|
|
|
|
method: "post",
|
|
|
|
data:data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-18 10:30:10 +08:00
|
|
|
// 查询用户个人信息
|
|
|
|
export function getUserProfile() {
|
|
|
|
return request({
|
|
|
|
url: '/system/user/profile',
|
|
|
|
method: 'get'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// 修改用户个人信息
|
|
|
|
export function updateUserProfile(data) {
|
|
|
|
return request({
|
|
|
|
url: '/system/user/profile',
|
|
|
|
method: 'put',
|
|
|
|
data: data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// 用户头像上传
|
|
|
|
export function uploadAvatar(data) {
|
|
|
|
return upload({
|
|
|
|
url: '/system/user/profile/avatar',
|
|
|
|
name: data.name,
|
|
|
|
filePath: data.filePath
|
|
|
|
})
|
|
|
|
}
|
2024-11-22 10:38:49 +08:00
|
|
|
|
2024-11-27 14:56:15 +08:00
|
|
|
// 用户头像上传
|
|
|
|
export function uploadAvatarForUser(data) {
|
|
|
|
return upload({
|
|
|
|
url: '/system/app/user/profile/avatarForUser',
|
|
|
|
name: data.name,
|
|
|
|
filePath: data.filePath,
|
|
|
|
formData:data.formData
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-11-22 10:38:49 +08:00
|
|
|
// 查询运维人员用户列表
|
|
|
|
export function allListUser (query) {
|
|
|
|
return request({
|
|
|
|
url: '/system/user/allList',
|
|
|
|
method: 'get',
|
|
|
|
params: query
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-11-22 17:29:55 +08:00
|
|
|
// 查询用户列表
|
|
|
|
export function getUserList(data) {
|
|
|
|
return request({
|
2024-11-27 14:56:15 +08:00
|
|
|
url: '/system/app/user/getUserList',
|
2024-11-22 17:29:55 +08:00
|
|
|
method: 'get',
|
|
|
|
data:data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 查询用户详细
|
|
|
|
export function getUser (userId) {
|
|
|
|
return request({
|
|
|
|
url: '/system/user/' + userId,
|
|
|
|
method: 'get'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// 新增用户
|
|
|
|
export function addUser (data) {
|
|
|
|
return request({
|
|
|
|
url: '/system/user',
|
|
|
|
method: 'post',
|
|
|
|
data: data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// 修改用户
|
|
|
|
export function updateUser (data) {
|
|
|
|
return request({
|
|
|
|
url: '/system/user',
|
|
|
|
method: 'put',
|
|
|
|
data: data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// 删除用户
|
|
|
|
export function delUser (userId) {
|
|
|
|
return request({
|
|
|
|
url: '/system/user/' + userId,
|
|
|
|
method: 'delete'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|