mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-25 06:57:12 +08:00
feat: 新增角色管理
This commit is contained in:
@@ -9,6 +9,11 @@ export function listDeptTree(query: { description: string }) {
|
||||
return http.get<TreeNodeData[]>(`${BASE_URL}/tree/dept`, query)
|
||||
}
|
||||
|
||||
/** @desc 查询菜单树 */
|
||||
export function listMenuTree(query: { description: string }) {
|
||||
return http.get<TreeNodeData[]>(`${BASE_URL}/tree/menu`, query)
|
||||
}
|
||||
|
||||
/** @desc 查询角色列表 */
|
||||
export function listRoleDict(query?: { name: string; status: number }) {
|
||||
return http.get<LabelValueState[]>(`${BASE_URL}/dict/role`, query)
|
||||
|
@@ -1,3 +1,4 @@
|
||||
export * from './role'
|
||||
export * from './menu'
|
||||
export * from './dept'
|
||||
export * from './log'
|
||||
|
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}`)
|
||||
}
|
@@ -1,3 +1,41 @@
|
||||
/** 系统角色类型 */
|
||||
export interface RoleResp {
|
||||
id: string
|
||||
name: string
|
||||
code: string
|
||||
sort: number
|
||||
description: string
|
||||
dataScope: number
|
||||
status: 1 | 2
|
||||
isSystem: boolean
|
||||
createUserString: string
|
||||
createTime: string
|
||||
updateUserString: string
|
||||
updateTime: string
|
||||
disabled: boolean
|
||||
}
|
||||
export interface RoleDetailResp {
|
||||
id: string
|
||||
name: string
|
||||
code: string
|
||||
sort: number
|
||||
description: string
|
||||
menuIds: Array<number>
|
||||
dataScope: number
|
||||
deptIds: Array<number>
|
||||
status: 1 | 2
|
||||
isSystem: boolean
|
||||
createUserString: string
|
||||
createTime: string
|
||||
updateUserString: string
|
||||
updateTime: string
|
||||
disabled: boolean
|
||||
}
|
||||
export interface RoleQuery extends PageQuery {
|
||||
description?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
/** 系统菜单类型 */
|
||||
export interface MenuResp {
|
||||
id: string
|
||||
|
Reference in New Issue
Block a user