2021-03-03 15:06:52 +08:00
|
|
|
import request from '@/utils/request'
|
2021-03-03 17:38:41 +08:00
|
|
|
const pathMap = {
|
|
|
|
queryPath: '/api/user/userGrid/',
|
|
|
|
deletePath: '/api/user/delete/',
|
|
|
|
createPath: '/api/user/create',
|
|
|
|
updatePath: '/api/user/update',
|
2021-03-08 18:19:57 +08:00
|
|
|
editPasswordPath: '/api/user/updatePwd',
|
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
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export default { editPassword, delUser, editUser, addUser, userLists, editStatus }
|