2021-03-03 15:06:52 +08:00
|
|
|
import request from '@/utils/request'
|
|
|
|
|
|
|
|
export function allRoles() {
|
|
|
|
return request({
|
|
|
|
url: '/api/role/all',
|
2021-03-11 14:09:38 +08:00
|
|
|
method: 'post',
|
|
|
|
loading: true
|
2021-03-03 15:06:52 +08:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function roleGrid(pageIndex, pageSize, data) {
|
|
|
|
return request({
|
|
|
|
url: '/api/role/roleGrid/' + pageIndex + '/' + pageSize,
|
|
|
|
method: 'post',
|
2021-03-11 14:09:38 +08:00
|
|
|
data,
|
|
|
|
loading: true
|
2021-03-03 15:06:52 +08:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function delRole(pid) {
|
|
|
|
return request({
|
|
|
|
url: '/api/role/delete/' + pid,
|
|
|
|
method: 'post'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function addRole(data) {
|
|
|
|
return request({
|
|
|
|
url: '/api/role/create',
|
|
|
|
method: 'post',
|
|
|
|
data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function editRole(data) {
|
|
|
|
return request({
|
|
|
|
url: '/api/role/update',
|
|
|
|
method: 'post',
|
|
|
|
data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function addRoleMenus(data) {
|
|
|
|
return request({
|
|
|
|
url: '/api/role/saveRolesMenus',
|
|
|
|
method: 'post',
|
|
|
|
data
|
|
|
|
})
|
|
|
|
}
|
2021-03-05 17:20:45 +08:00
|
|
|
|
|
|
|
export function menuIds(roleId) {
|
|
|
|
return request({
|
|
|
|
url: '/api/role/menuIds/' + roleId,
|
|
|
|
method: 'post'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
export default { addRole, editRole, delRole, roleGrid, allRoles, addRoleMenus, menuIds }
|