提交 | 用户 | 时间
|
fd2207
|
1 |
import request from '@/utils/request' |
懒 |
2 |
|
|
3 |
// 查询角色列表 |
|
4 |
export function listRole(query) { |
|
5 |
return request({ |
|
6 |
url: '/system/role/list', |
|
7 |
method: 'get', |
|
8 |
params: query |
|
9 |
}) |
|
10 |
} |
|
11 |
|
|
12 |
// 查询角色详细 |
|
13 |
export function getRole(roleId) { |
|
14 |
return request({ |
|
15 |
url: '/system/role/' + roleId, |
|
16 |
method: 'get' |
|
17 |
}) |
|
18 |
} |
|
19 |
|
|
20 |
// 新增角色 |
|
21 |
export function addRole(data) { |
|
22 |
return request({ |
|
23 |
url: '/system/role', |
|
24 |
method: 'post', |
|
25 |
data: data |
|
26 |
}) |
|
27 |
} |
|
28 |
|
|
29 |
// 修改角色 |
|
30 |
export function updateRole(data) { |
|
31 |
return request({ |
|
32 |
url: '/system/role', |
|
33 |
method: 'put', |
|
34 |
data: data |
|
35 |
}) |
|
36 |
} |
|
37 |
|
|
38 |
// 角色数据权限 |
|
39 |
export function dataScope(data) { |
|
40 |
return request({ |
|
41 |
url: '/system/role/dataScope', |
|
42 |
method: 'put', |
|
43 |
data: data |
|
44 |
}) |
|
45 |
} |
|
46 |
|
|
47 |
// 角色状态修改 |
|
48 |
export function changeRoleStatus(roleId, status) { |
|
49 |
const data = { |
|
50 |
roleId, |
|
51 |
status |
|
52 |
} |
|
53 |
return request({ |
|
54 |
url: '/system/role/changeStatus', |
|
55 |
method: 'put', |
|
56 |
data: data |
|
57 |
}) |
|
58 |
} |
|
59 |
|
|
60 |
// 删除角色 |
|
61 |
export function delRole(roleId) { |
|
62 |
return request({ |
|
63 |
url: '/system/role/' + roleId, |
|
64 |
method: 'delete' |
|
65 |
}) |
|
66 |
} |
|
67 |
|
|
68 |
// 查询角色已授权用户列表 |
|
69 |
export function allocatedUserList(query) { |
|
70 |
return request({ |
|
71 |
url: '/system/role/authUser/allocatedList', |
|
72 |
method: 'get', |
|
73 |
params: query |
|
74 |
}) |
|
75 |
} |
|
76 |
|
|
77 |
// 查询角色未授权用户列表 |
|
78 |
export function unallocatedUserList(query) { |
|
79 |
return request({ |
|
80 |
url: '/system/role/authUser/unallocatedList', |
|
81 |
method: 'get', |
|
82 |
params: query |
|
83 |
}) |
|
84 |
} |
|
85 |
|
|
86 |
// 取消用户授权角色 |
|
87 |
export function authUserCancel(data) { |
|
88 |
return request({ |
|
89 |
url: '/system/role/authUser/cancel', |
|
90 |
method: 'put', |
|
91 |
data: data |
|
92 |
}) |
|
93 |
} |
|
94 |
|
|
95 |
// 批量取消用户授权角色 |
|
96 |
export function authUserCancelAll(data) { |
|
97 |
return request({ |
|
98 |
url: '/system/role/authUser/cancelAll', |
|
99 |
method: 'put', |
|
100 |
params: data |
|
101 |
}) |
|
102 |
} |
|
103 |
|
|
104 |
// 授权用户选择 |
|
105 |
export function authUserSelectAll(data) { |
|
106 |
return request({ |
|
107 |
url: '/system/role/authUser/selectAll', |
|
108 |
method: 'put', |
|
109 |
params: data |
|
110 |
}) |
|
111 |
} |
|
112 |
|
|
113 |
// 根据角色ID查询部门树结构 |
|
114 |
export function deptTreeSelect(roleId) { |
|
115 |
return request({ |
|
116 |
url: '/system/role/deptTree/' + roleId, |
|
117 |
method: 'get' |
|
118 |
}) |
|
119 |
} |