提交 | 用户 | 时间
|
820397
|
1 |
import request from '@/config/axios' |
H |
2 |
|
|
3 |
export interface PermissionAssignUserRoleReqVO { |
|
4 |
userId: number |
|
5 |
roleIds: number[] |
|
6 |
} |
|
7 |
|
|
8 |
export interface PermissionAssignRoleMenuReqVO { |
|
9 |
roleId: number |
|
10 |
menuIds: number[] |
|
11 |
} |
|
12 |
|
|
13 |
export interface PermissionAssignRoleDataScopeReqVO { |
|
14 |
roleId: number |
|
15 |
dataScope: number |
|
16 |
dataScopeDeptIds: number[] |
|
17 |
} |
|
18 |
|
|
19 |
// 查询角色拥有的菜单权限 |
|
20 |
export const getRoleMenuList = async (roleId: number) => { |
|
21 |
return await request.get({ url: '/system/permission/list-role-menus?roleId=' + roleId }) |
|
22 |
} |
|
23 |
|
|
24 |
// 赋予角色菜单权限 |
|
25 |
export const assignRoleMenu = async (data: PermissionAssignRoleMenuReqVO) => { |
|
26 |
return await request.post({ url: '/system/permission/assign-role-menu', data }) |
|
27 |
} |
|
28 |
|
|
29 |
// 赋予角色数据权限 |
|
30 |
export const assignRoleDataScope = async (data: PermissionAssignRoleDataScopeReqVO) => { |
|
31 |
return await request.post({ url: '/system/permission/assign-role-data-scope', data }) |
|
32 |
} |
|
33 |
|
|
34 |
// 查询用户拥有的角色数组 |
|
35 |
export const getUserRoleList = async (userId: number) => { |
|
36 |
return await request.get({ url: '/system/permission/list-user-roles?userId=' + userId }) |
|
37 |
} |
|
38 |
|
|
39 |
// 赋予用户角色 |
|
40 |
export const assignUserRole = async (data: PermissionAssignUserRoleReqVO) => { |
|
41 |
return await request.post({ url: '/system/permission/assign-user-role', data }) |
|
42 |
} |