dataease-dm/frontend/src/api/system/user.js

85 lines
1.7 KiB
JavaScript
Raw Normal View History

2021-03-03 15:06:52 +08:00
import request from '@/utils/request'
2021-03-03 17:38:41 +08:00
const pathMap = {
2021-05-13 16:00:15 +08:00
userUpdatePwdPath: '/api/user/updatePwd/',
personInfoPath: '/api/user/personInfo/',
piupdatePath: '/api/user/updatePersonInfo/',
2021-03-03 17:38:41 +08:00
queryPath: '/api/user/userGrid/',
deletePath: '/api/user/delete/',
createPath: '/api/user/create',
updatePath: '/api/user/update',
2021-03-09 15:38:36 +08:00
editPasswordPath: '/api/user/adminUpdatePwd',
2021-03-03 17:38:41 +08:00
editStatusPath: '/api/user/updateStatus'
}
2021-03-03 15:06:52 +08:00
export function userLists(page, size, data) {
return request({
2021-03-03 17:38:41 +08:00
url: pathMap.queryPath + page + '/' + size,
method: 'post',
2021-03-04 14:58:52 +08:00
data,
loading: true
2021-03-03 17:38:41 +08:00
})
}
export const addUser = (data) => {
return request({
url: pathMap.createPath,
2021-03-03 15:06:52 +08:00
method: 'post',
data
})
}
2021-03-03 17:38:41 +08:00
export const editUser = (data) => {
return request({
url: pathMap.updatePath,
method: 'post',
data
})
}
export const delUser = (userId) => {
return request({
url: pathMap.deletePath + userId,
method: 'post'
})
}
export const editPassword = (data) => {
return request({
url: pathMap.editPasswordPath,
method: 'post',
data
})
}
export const editStatus = (data) => {
return request({
url: pathMap.editStatusPath,
method: 'post',
data
})
}
2021-05-13 16:00:15 +08:00
export const persionInfo = () => {
return request({
url: pathMap.personInfoPath,
method: 'post'
})
}
export const updatePerson = (data) => {
return request({
url: pathMap.piupdatePath,
method: 'post',
data
})
}
export const updatePersonPwd = (data) => {
return request({
url: pathMap.userUpdatePwdPath,
method: 'post',
data
})
}
export default { editPassword, delUser, editUser, addUser, userLists, editStatus, persionInfo, updatePerson, updatePersonPwd }