yinghe-lowcode-zln
Version:
基于vue、ant-design-vue,datagrid的低代码平台
151 lines (134 loc) • 2.64 kB
JavaScript
import { axios } from '@/utils/request'
// 查询用户列表
export function listUser(query) {
return axios({
url: '/system/user/list',
method: 'get',
params: query,
})
}
// 查询用户列表 无分页
export function listNoPage(query) {
return axios({
url: '/system/user/listNoPage',
method: 'get',
params: query,
})
}
// 查询用户详细
export function getUser(userId) {
return axios({
url: '/system/user/' + praseStrEmpty(userId),
method: 'get',
})
}
export function praseStrEmpty(str) {
if (!str || str === 'undefined' || str === 'null') {
return ''
}
return str
}
// 新增用户
export function addUser(data) {
return axios({
url: '/system/user',
method: 'post',
data: data,
})
}
//根据组织获取角色
export function orgRole(orgId) {
return axios({
url: '/system/role/rolesByOrgId/' + orgId,
method: 'get',
})
}
// 修改用户
export function updateUser(data) {
return axios({
url: '/system/user/edit',
method: 'post',
data: data,
})
}
// 删除用户
export function delUser(userId) {
return axios({
url: '/system/user/delete/' + userId,
method: 'get',
})
}
// 导出用户
export function exportUser(query) {
return axios({
url: '/system/user/export',
method: 'get',
params: query,
})
}
// 用户密码重置
export function resetUserPwd(userId, password) {
const data = {
userId,
password,
}
return axios({
url: '/system/user/resetPwd/edit',
method: 'post',
data: data,
})
}
// 用户状态修改
export function changeUserStatus(userId, status) {
const data = {
userId,
status,
}
return axios({
url: '/system/user/changeStatus/edit',
method: 'post',
data: data,
})
}
// 查询用户个人信息
export function getUserProfile() {
return axios({
url: '/system/user/profile',
method: 'get',
})
}
// 修改用户个人信息
export function updateUserProfile(data) {
return axios({
url: '/system/user/profile/edit',
method: 'post',
data: data,
})
}
// 用户密码重置
export function updateUserPwd(oldPassword, newPassword) {
const data = {
oldPassword,
newPassword,
}
return axios({
url: '/system/user/profile/updatePwd/edit',
method: 'post',
params: data,
})
}
// 用户头像上传
export function uploadAvatar(data) {
return axios({
url: '/system/user/profile/avatar',
method: 'post',
data: data,
})
}
// 下载用户导入模板
export function importTemplate() {
return axios({
url: '/system/user/importTemplate',
method: 'get',
})
}