You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.3 KiB
43 lines
1.3 KiB
1 year ago
|
import request from '@/config/axios'
|
||
|
|
||
|
export interface PermissionAssignUserRoleReqVO {
|
||
|
userId: number
|
||
|
roleIds: number[]
|
||
|
}
|
||
|
|
||
|
export interface PermissionAssignRoleMenuReqVO {
|
||
|
roleId: number
|
||
|
menuIds: number[]
|
||
|
}
|
||
|
|
||
|
export interface PermissionAssignRoleDataScopeReqVO {
|
||
|
roleId: number
|
||
|
dataScope: number
|
||
|
dataScopeDeptIds: number[]
|
||
|
}
|
||
|
|
||
|
// 查询角色拥有的菜单权限
|
||
|
export const getRoleMenuList = async (roleId: number) => {
|
||
|
return await request.get({ url: '/system/permission/list-role-menus?roleId=' + roleId })
|
||
|
}
|
||
|
|
||
|
// 赋予角色菜单权限
|
||
|
export const assignRoleMenu = async (data: PermissionAssignRoleMenuReqVO) => {
|
||
|
return await request.post({ url: '/system/permission/assign-role-menu', data })
|
||
|
}
|
||
|
|
||
|
// 赋予角色数据权限
|
||
|
export const assignRoleDataScope = async (data: PermissionAssignRoleDataScopeReqVO) => {
|
||
|
return await request.post({ url: '/system/permission/assign-role-data-scope', data })
|
||
|
}
|
||
|
|
||
|
// 查询用户拥有的角色数组
|
||
|
export const getUserRoleList = async (userId: number) => {
|
||
|
return await request.get({ url: '/system/permission/list-user-roles?userId=' + userId })
|
||
|
}
|
||
|
|
||
|
// 赋予用户角色
|
||
|
export const assignUserRole = async (data: PermissionAssignUserRoleReqVO) => {
|
||
|
return await request.post({ url: '/system/permission/assign-user-role', data })
|
||
|
}
|