vue-pro/yudao-ui-admin-vue3/src/api/system/role/index.ts

38 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-11-03 16:55:01 +08:00
import request from '@/config/axios'
2022-07-18 19:06:37 +08:00
import type { RoleVO } from './types'
// 查询角色列表
2022-08-01 19:03:27 +08:00
export const getRolePageApi = async (params) => {
return await request.get({ url: '/system/role/page', params })
}
// 查询角色(精简)列表
export const listSimpleRolesApi = async () => {
return await request.get({ url: '/system/role/list-all-simple' })
2022-07-18 19:06:37 +08:00
}
// 查询角色详情
2022-08-01 19:03:27 +08:00
export const getRoleApi = async (id: number) => {
return await request.get({ url: '/system/role/get?id=' + id })
2022-07-18 19:06:37 +08:00
}
// 新增角色
2022-08-01 19:03:27 +08:00
export const createRoleApi = async (data: RoleVO) => {
return await request.post({ url: '/system/role/create', data })
2022-07-18 19:06:37 +08:00
}
// 修改角色
2022-08-01 19:03:27 +08:00
export const updateRoleApi = async (data: RoleVO) => {
return await request.put({ url: '/system/role/update', data })
2022-07-18 19:06:37 +08:00
}
// 修改角色状态
2022-08-01 19:03:27 +08:00
export const updateRoleStatusApi = async (data: RoleVO) => {
return await request.put({ url: '/system/role/update-status', data })
2022-07-18 19:06:37 +08:00
}
// 删除角色
2022-08-01 19:03:27 +08:00
export const deleteRoleApi = async (id: number) => {
return await request.delete({ url: '/system/role/delete?id=' + id })
2022-07-18 19:06:37 +08:00
}