gaoluyang
2026-06-24 712aa51536236d43e87273e4ce45ac5691dffad8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { MenuType } from '..\..\..\packages\constants\src';
 
import { requestClient } from '#/api/request';
 
export namespace MpMenuApi {
  /** 菜单按钮信息 */
  export interface MenuButton {
    type: MenuType;
    name: string;
    key?: string;
    url?: string;
    mediaId?: string;
    appId?: string;
    pagePath?: string;
    subButtons?: MenuButton[];
  }
 
  /** 菜单信息 */
  export interface Menu {
    accountId: number;
    menus: MenuButton[];
  }
}
 
/** 查询菜单列表 */
export function getMenuList(accountId: number) {
  return requestClient.get<MpMenuApi.MenuButton[]>('/mp/menu/list', {
    params: { accountId },
  });
}
 
/** 保存菜单 */
export function saveMenu(accountId: number, menus: MpMenuApi.MenuButton[]) {
  return requestClient.post('/mp/menu/save', {
    accountId,
    menus,
  });
}
 
/** 删除菜单 */
export function deleteMenu(accountId: number) {
  return requestClient.delete('/mp/menu/delete', {
    params: { accountId },
  });
}