Files
pqs-9100_client/frontend/src/api/role/role.ts

38 lines
1008 B
TypeScript
Raw Normal View History

2024-11-12 18:56:33 +08:00
import type { ResPage } from '@/api/interface'
import type { Role } from './interface'
2024-10-16 11:27:17 +08:00
import { ADMIN as rePrefix } from '@/api/config/serviceName'
import http from '@/api'
/**
* @name
*/
// 获取角色列表
export const getRoleList = (params: Role.ReqRoleParams) => {
2024-11-12 18:56:33 +08:00
return http.get(`/sysRole/list`, params)
// return http.post<ResPage<Role.ResRoleList>>(`/RoleList_Post`, params)
// return http.post<ResPage<Role.ResRoleList>>(`${rePrefix}/role/list`, params)
2024-10-16 11:27:17 +08:00
}
// 新增角色
export const addRole = (params: Role.RoleBO) => {
2024-11-12 18:56:33 +08:00
return http.post(`/sysRole/add`, params)
2024-10-16 11:27:17 +08:00
}
// 编辑角色
export const editRole = (params: Role.RoleBO) => {
2024-11-12 18:56:33 +08:00
return http.put(`/sysRole/edit`, params)
2024-10-16 11:27:17 +08:00
}
// 删除角色
export const deleteRole = (params: { id: string[] }) => {
2024-11-12 18:56:33 +08:00
return http.post(`/sysRole/del`, params)
2024-10-16 11:27:17 +08:00
}
// 编辑角色资源
export const editRoleAndPermission = (params: Role.ReqRoleAndPermission) => {
return http.post(`/role/edit_RoleAndPermission`, params)
2024-10-16 11:27:17 +08:00
}