diff --git a/src/api/permission.js b/src/api/permission.js new file mode 100644 index 0000000..ddd1698 --- /dev/null +++ b/src/api/permission.js @@ -0,0 +1,65 @@ +import api from '@/utils/api' +import qs from 'qs' + +export function add(data) { + return api({ + url: '/permission', + method: 'post', + data + }) +} + +export function edit(data) { + return api({ + url: '/permission', + method: 'put', + data + }) +} +export function del(params) { + return api({ + url: '/permission', + method: 'delete', + params, + paramsSerializer: function(params) { + return qs.stringify(params, { indices: false }) + } + }) +} + +export function getList(params) { + return api({ + url: '/permission/list', + method: 'get', + params + }) +} + +export function getPermissionsByRoleId(roleId) { + return api({ + url: '/permission/getPermissionsByRoleId', + method: 'get', + params: { + roleId: roleId + } + }) +} + +export function getPermissionTypesById(permissionId) { + return api({ + url: '/permission/getPermissionTypesById', + method: 'get', + params: { + permissionId: permissionId + } + }) +} + +export function getTree() { + return api({ + url: '/permission/tree', + method: 'get' + }) +} + +export default { add, edit, del } diff --git a/src/api/role.js b/src/api/role.js index e949511..a812ffb 100644 --- a/src/api/role.js +++ b/src/api/role.js @@ -27,9 +27,9 @@ export function del(params) { }) } -export function getRoleList(params) { +export function getList(params) { return api({ - url: '/role', + url: '/role/list', method: 'get', params }) @@ -49,4 +49,4 @@ export function getAllRole() { }) } -export default { add, edit, del, getRoleMenuList } +export default { add, edit, del, getList } diff --git a/src/views/bggl/banjie_list.vue b/src/views/bggl/banjie_list.vue index 603c461..f5ebda6 100644 --- a/src/views/bggl/banjie_list.vue +++ b/src/views/bggl/banjie_list.vue @@ -3,35 +3,23 @@