mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-13 14:57:14 +08:00
feat: 新增角色管理
This commit is contained in:
29
src/apis/system/role.ts
Normal file
29
src/apis/system/role.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import http from '@/utils/http'
|
||||
import type * as System from './type'
|
||||
|
||||
const BASE_URL = '/system/role'
|
||||
|
||||
/** @desc 查询角色列表 */
|
||||
export function listRole(query: System.RoleQuery) {
|
||||
return http.get<PageRes<System.RoleResp[]>>(`${BASE_URL}`, query)
|
||||
}
|
||||
|
||||
/** @desc 查询角色详情 */
|
||||
export function getRole(id: string) {
|
||||
return http.get<System.RoleDetailResp>(`${BASE_URL}/${id}`)
|
||||
}
|
||||
|
||||
/** @desc 新增角色 */
|
||||
export function addRole(data: any) {
|
||||
return http.post(`${BASE_URL}`, data)
|
||||
}
|
||||
|
||||
/** @desc 修改角色 */
|
||||
export function updateRole(data: any, id: string) {
|
||||
return http.put(`${BASE_URL}/${id}`, data)
|
||||
}
|
||||
|
||||
/** @desc 删除角色 */
|
||||
export function deleteRole(ids: string | Array<string>) {
|
||||
return http.del(`${BASE_URL}/${ids}`)
|
||||
}
|
Reference in New Issue
Block a user