Files
shz-admin/src/services/system/menu.ts
chenshaohua 30c8a7e8cf
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
first commit
2025-11-10 16:28:01 +08:00

62 lines
1.6 KiB
TypeScript

import { request } from '@umijs/max';
import { downLoadXlsx } from '@/utils/downloadfile';
// 查询菜单权限列表
export async function getMenuList(params?: API.System.MenuListParams, options?: { [key: string]: any }) {
return request<API.System.MenuPageResult>('/api/system/menu/list', {
method: 'GET',
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
params,
...(options || {}),
});
}
// 查询菜单权限详细
export function getMenu(menuId: number, options?: { [key: string]: any }) {
return request<API.System.MenuInfoResult>(`/api/system/menu/${menuId}`, {
method: 'GET',
...(options || {})
});
}
// 新增菜单权限
export async function addMenu(params: API.System.Menu, options?: { [key: string]: any }) {
return request<API.Result>('/api/system/menu', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
data: params,
...(options || {})
});
}
// 修改菜单权限
export async function updateMenu(params: API.System.Menu, options?: { [key: string]: any }) {
return request<API.Result>('/api/system/menu', {
method: 'PUT',
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
data: params,
...(options || {})
});
}
// 删除菜单权限
export async function removeMenu(ids: string, options?: { [key: string]: any }) {
return request<API.Result>(`/api/system/menu/${ids}`, {
method: 'DELETE',
...(options || {})
});
}
// 查询菜单权限详细
export function getMenuTree() {
return request('/api/system/menu/treeselect', {
method: 'GET',
});
}