153 lines
2.9 KiB
JavaScript
153 lines
2.9 KiB
JavaScript
import request from '@/utils/request'
|
|
import { parseStrEmpty } from "@/utils/ruoyi";
|
|
|
|
// 鏌ヨ鐢ㄦ埛鍒楄〃
|
|
export function listUser(query) {
|
|
return request({
|
|
url: '/system/user/list',
|
|
method: 'get',
|
|
params: query
|
|
})
|
|
}
|
|
|
|
// 鏌ヨ鐢ㄦ埛璇︾粏
|
|
export function getUser(userId) {
|
|
return request({
|
|
url: '/system/user/' + parseStrEmpty(userId),
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
// 鏂板鐢ㄦ埛
|
|
export function addUser(data) {
|
|
return request({
|
|
url: '/system/user/add',
|
|
method: 'post',
|
|
headers: {
|
|
'Content-Type': 'multipart/form-data'
|
|
},
|
|
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'
|
|
})
|
|
}
|
|
|
|
// 鐢ㄦ埛瀵嗙爜閲嶇疆
|
|
export function resetUserPwd(data) {
|
|
|
|
return request({
|
|
url: '/system/user/resetPwd',
|
|
method: 'post',
|
|
headers: {
|
|
'Content-Type': 'multipart/form-data'
|
|
},
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// 鐢ㄦ埛鐘舵€佷慨鏀?
|
|
export function changeUserStatus(userId, status) {
|
|
const data = {
|
|
userId,
|
|
status
|
|
}
|
|
return request({
|
|
url: '/system/user/changeStatus',
|
|
method: 'post',
|
|
headers: {
|
|
'Content-Type': 'multipart/form-data'
|
|
},
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// 鏌ヨ鐢ㄦ埛涓汉淇℃伅
|
|
export function getUserProfile() {
|
|
return request({
|
|
url: '/system/user/profile/vue',
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
// 淇敼鐢ㄦ埛涓汉淇℃伅
|
|
export function updateUserProfile(data) {
|
|
return request({
|
|
url: '/system/user/profile',
|
|
method: 'put',
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// 鐢ㄦ埛瀵嗙爜閲嶇疆
|
|
export function updateUserPwd(data) {
|
|
return request({
|
|
url: '/system/user/profile/resetPwd',
|
|
method: 'post',
|
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// 鐢ㄦ埛澶村儚涓婁紶
|
|
export function uploadAvatar(data) {
|
|
return request({
|
|
url: '/system/user/profile/updateAvatar',
|
|
method: 'post',
|
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
data: data
|
|
})
|
|
}
|
|
|
|
export function getUserBotProfile() {
|
|
return request({
|
|
url: '/system/user/profile/bot',
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
export function generateUserBotProfile() {
|
|
return request({
|
|
url: '/system/user/profile/bot/generate',
|
|
method: 'post'
|
|
})
|
|
}
|
|
// 鏌ヨ鎺堟潈瑙掕壊
|
|
export function getAuthRole(userId) {
|
|
return request({
|
|
url: '/system/user/vue/authRole/' + userId,
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
// 淇濆瓨鎺堟潈瑙掕壊
|
|
export function updateAuthRole(data) {
|
|
return request({
|
|
url: '/system/user/authRole',
|
|
method: 'put',
|
|
params: data
|
|
})
|
|
}
|
|
|
|
// 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋?
|
|
export function deptTreeSelect() {
|
|
return request({
|
|
url: '/system/user/deptTree',
|
|
method: 'get'
|
|
})
|
|
}
|