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

95 lines
2.5 KiB
TypeScript
Raw Normal View History

2024-10-16 11:27:17 +08:00
import { ResPage } from '@/api/interface'
import { Role } from './interface'
import { ADMIN as rePrefix } from '@/api/config/serviceName'
import http from '@/api'
/**
* @name
*/
// 获取角色列表
export const getRoleList = (params: Role.ReqRoleParams) => {
return http.post<ResPage<Role.RoleBO>>(`/role/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) => {
return http.post(`/role/add`, params)
2024-10-16 11:27:17 +08:00
}
// 编辑角色
export const editRole = (params: Role.RoleBO) => {
return http.post(`/role/edit`, params)
2024-10-16 11:27:17 +08:00
}
// 删除角色
export const deleteRole = (params: { id: string[] }) => {
return http.post(`/role/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
}
// // 获取树形用户列表
// export const getRoleTreeList = (params: Role.ReqRoleParams) => {
// return http.post<ResPage<Role.ResRoleList>>(`${rePrefix}/role/tree/list`, params)
// }
// export const addRole = (params: { id: string ; rolename: string;status: number; describe:string; }) => {
// return http.post(`/RoleList_Add`, params)
// }
// 批量添加角色
// export const BatchAddRole = (params: FormData) => {
// return http.post(`${rePrefix}/role/import`, params)
// }
// // 切换角色状态
// export const changeRoleStatus = (params: { id: string; status: number }) => {
// return http.post(`${rePrefix}/role/change`, params)
// }
2024-10-16 11:27:17 +08:00
// 重置用户密码
// export const resetUserPassWord = (params: { id: string }) => {
// return http.post(`${rePrefix}/role/rest_password`, params)
// }
// 导出角色数据
// export const exportRoleInfo = (params: Role.ReqRoleParams) => {
// return http.download(`${rePrefix}/role/export`, params)
// }
2024-10-16 11:27:17 +08:00
// 获取角色状态字典
// export const getRoleStatus = () => {
// return http.get<Role.ResStatus[]>(`${rePrefix}/role/status`)
// }
2024-10-16 11:27:17 +08:00
// 获取用户性别字典
// export const getUserGender = () => {
// return http.get<User.ResGender[]>(`${rePrefix}/user/gender`)
// }
// 获取角色权限列表
// export const getRoleDepartment = () => {
// return http.get<Role.ResPermissionList[]>(`${rePrefix}/role/permission`)
// }
2024-10-16 11:27:17 +08:00
// 获取用户角色字典
// export const getUserRole = () => {
// return http.get<User.ResRole[]>(`${rePrefix}/user/role`)
// }