微调
This commit is contained in:
46
frontend/src/api/user/role/index.ts
Normal file
46
frontend/src/api/user/role/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import type { Role } from '@/api/user/interface/role'
|
||||
import type { Function } from '@/api/user/interface/function'
|
||||
import http from '@/api'
|
||||
|
||||
/**
|
||||
* @name 角色管理模块
|
||||
*/
|
||||
// 获取角色列表
|
||||
export const getRoleList = (params: Role.ReqRoleParams) => {
|
||||
return http.post(`/sysRole/list`, params)
|
||||
|
||||
// return http.post<ResPage<Role.ResRoleList>>(`/RoleList_Post`, params)
|
||||
// return http.post<ResPage<Role.ResRoleList>>(`${rePrefix}/role/list`, params)
|
||||
}
|
||||
|
||||
// 新增角色
|
||||
export const addRole = (params: Role.RoleBO) => {
|
||||
return http.post(`/sysRole/add`, params)
|
||||
}
|
||||
|
||||
// 编辑角色
|
||||
export const editRole = (params: Role.RoleBO) => {
|
||||
return http.post(`/sysRole/update`, params)
|
||||
}
|
||||
|
||||
// 删除角色
|
||||
export const deleteRole = (params: { id: string[] }) => {
|
||||
return http.post(`/sysRole/delete`, params)
|
||||
}
|
||||
|
||||
|
||||
// 获取资源
|
||||
export const getFunctionList = () => {
|
||||
return http.get<Function.ResFunction>(`/sysFunction/functionTree`)
|
||||
}
|
||||
|
||||
|
||||
//获取角色id绑定的菜单
|
||||
export const getRoleFunction = (params:Role.RoleBO) => {
|
||||
return http.post(`/sysRole/getFunctionsByRoleId?id=${params.id}`)
|
||||
}
|
||||
|
||||
//角色分配菜单
|
||||
export const assignFunction = (params:Role.RoleBO,param:Role.RoleFunctionId) => {
|
||||
return http.post(`/sysFunction/assignFunctionByRoleId`,{ roleId: params.id,functionIds:param.id })
|
||||
}
|
||||
Reference in New Issue
Block a user